Fixed issue with unit tests
Fake test playlists were breaking when they didn’t have segments.
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -248,6 +248,10 @@ videojs.Hls.prototype.src = function(src) { | ... | @@ -248,6 +248,10 @@ videojs.Hls.prototype.src = function(src) { |
248 | the current time to go along with it. | 248 | the current time to go along with it. |
249 | */ | 249 | */ |
250 | videojs.Hls.getMediaIndexForLive = function(selectedPlaylist) { | 250 | videojs.Hls.getMediaIndexForLive = function(selectedPlaylist) { |
251 | if (!selectedPlaylist.segments) { | ||
252 | return 0; | ||
253 | } | ||
254 | |||
251 | var tailIterator = selectedPlaylist.segments.length, | 255 | var tailIterator = selectedPlaylist.segments.length, |
252 | tailDuration = 0, | 256 | tailDuration = 0, |
253 | targetTail = (selectedPlaylist.targetDuration || 10) * 3; | 257 | targetTail = (selectedPlaylist.targetDuration || 10) * 3; | ... | ... |
-
Please register or sign in to post a comment