Merge pull request #407 from videojs/fix-handlesourceopen
There are cases when a mediasource is re-opened and we need to account for that
Showing
1 changed file
with
6 additions
and
1 deletions
... | @@ -292,7 +292,12 @@ videojs.Hls.getMediaIndexForLive_ = function(selectedPlaylist) { | ... | @@ -292,7 +292,12 @@ videojs.Hls.getMediaIndexForLive_ = function(selectedPlaylist) { |
292 | }; | 292 | }; |
293 | 293 | ||
294 | videojs.Hls.prototype.handleSourceOpen = function() { | 294 | videojs.Hls.prototype.handleSourceOpen = function() { |
295 | this.setupSourceBuffer_(); | 295 | // Only attempt to create the source buffer if none already exist. |
296 | // handleSourceOpen is also called when we are "re-opening" a source buffer | ||
297 | // after `endOfStream` has been called (in response to a seek for instance) | ||
298 | if (!this.sourceBuffer) { | ||
299 | this.setupSourceBuffer_(); | ||
300 | } | ||
296 | 301 | ||
297 | // if autoplay is enabled, begin playback. This is duplicative of | 302 | // if autoplay is enabled, begin playback. This is duplicative of |
298 | // code in video.js but is required because play() must be invoked | 303 | // code in video.js but is required because play() must be invoked | ... | ... |
-
Please register or sign in to post a comment