resolve test errors re flash setProperty
Showing
1 changed file
with
27 additions
and
10 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 | player.currentTime = function(value) { | 112 | if(player.ha === "Flash") |
113 | if(value) { | 113 | { |
114 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('currentTime', 0); | 114 | player.currentTime = function(value) { |
115 | player.hls.mediaIndex = player.hls.selectSegmentByTime(value); | 115 | if(value) { |
116 | fillBuffer(); | 116 | try { |
117 | } else { | 117 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('currentTime', 0); |
118 | return player.el().getElementsByClassName('vjs-tech')[0].vjs_getProperty('currentTime'); | 118 | } catch(err) { |
119 | } | 119 | |
120 | }; | 120 | } |
121 | player.hls.mediaIndex = player.hls.selectSegmentByTime(value); | ||
122 | fillBuffer(); | ||
123 | } else { | ||
124 | try { | ||
125 | return player.el().getElementsByClassName('vjs-tech')[0].vjs_getProperty('currentTime'); | ||
126 | } catch(err) { | ||
127 | return 0; | ||
128 | } | ||
129 | } | ||
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 |
237 | player.el().getElementsByClassName('vjs-tech')[0].vjs_setProperty('duration',parser.manifest.totalDuration); | 248 | if (player.ha === "Flash") { |
249 | try { | ||
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