resolve test errors re flash setProperty
Showing
1 changed file
with
17 additions
and
0 deletions
... | @@ -109,15 +109,26 @@ var | ... | @@ -109,15 +109,26 @@ var |
109 | return 1; // HAVE_METADATA | 109 | return 1; // HAVE_METADATA |
110 | }; | 110 | }; |
111 | 111 | ||
112 | if(player.ha === "Flash") | ||
113 | { | ||
112 | player.currentTime = function(value) { | 114 | player.currentTime = function(value) { |
113 | if(value) { | 115 | if(value) { |
116 | try { | ||
114 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('currentTime', 0); | 117 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('currentTime', 0); |
118 | } catch(err) { | ||
119 | |||
120 | } | ||
115 | player.hls.mediaIndex = player.hls.selectSegmentByTime(value); | 121 | player.hls.mediaIndex = player.hls.selectSegmentByTime(value); |
116 | fillBuffer(); | 122 | fillBuffer(); |
117 | } else { | 123 | } else { |
124 | try { | ||
118 | return player.el().getElementsByClassName('vjs-tech')[0].vjs_getProperty('currentTime'); | 125 | return player.el().getElementsByClassName('vjs-tech')[0].vjs_getProperty('currentTime'); |
126 | } catch(err) { | ||
127 | return 0; | ||
128 | } | ||
119 | } | 129 | } |
120 | }; | 130 | }; |
131 | } | ||
121 | 132 | ||
122 | player.hls.selectSegmentByTime = function(time) { | 133 | player.hls.selectSegmentByTime = function(time) { |
123 | var index, currentSegment; | 134 | var index, currentSegment; |
... | @@ -234,7 +245,13 @@ var | ... | @@ -234,7 +245,13 @@ var |
234 | // update the duration | 245 | // update the duration |
235 | player.duration(parser.manifest.totalDuration); | 246 | player.duration(parser.manifest.totalDuration); |
236 | // Notify the flash layer | 247 | // Notify the flash layer |
248 | if (player.ha === "Flash") { | ||
249 | try { | ||
237 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('duration',parser.manifest.totalDuration); | 250 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('duration',parser.manifest.totalDuration); |
251 | } catch (err) { | ||
252 | |||
253 | } | ||
254 | } | ||
238 | } | 255 | } |
239 | player.trigger('loadedmanifest'); | 256 | player.trigger('loadedmanifest'); |
240 | player.trigger('loadedmetadata'); | 257 | player.trigger('loadedmetadata'); | ... | ... |
-
Please register or sign in to post a comment