Adding a null check on the playlist
Some unit tests were failing when selectedPlaylist.segments was undefined.
Showing
1 changed file
with
1 additions
and
1 deletions
... | @@ -141,7 +141,7 @@ videojs.Hls.prototype.handleSourceOpen = function() { | ... | @@ -141,7 +141,7 @@ videojs.Hls.prototype.handleSourceOpen = function() { |
141 | segmentDlTime = Infinity; | 141 | segmentDlTime = Infinity; |
142 | } | 142 | } |
143 | 143 | ||
144 | if(this.duration() === Infinity && this.mediaIndex === 0) { | 144 | if(this.duration === Infinity && this.mediaIndex === 0 && selectedPlaylist.segments) { |
145 | var i = selectedPlaylist.segments.length - 1; | 145 | var i = selectedPlaylist.segments.length - 1; |
146 | var tailDuration = 0; | 146 | var tailDuration = 0; |
147 | while (tailDuration < 30 && i > 0) { | 147 | while (tailDuration < 30 && i > 0) { | ... | ... |
-
Please register or sign in to post a comment