Make sure that segments attribute exists.
Showing
1 changed file
with
5 additions
and
3 deletions
... | @@ -127,9 +127,11 @@ videojs.Hls.prototype.handleSourceOpen = function() { | ... | @@ -127,9 +127,11 @@ videojs.Hls.prototype.handleSourceOpen = function() { |
127 | oldMediaPlaylist = this.playlists.media(); | 127 | oldMediaPlaylist = this.playlists.media(); |
128 | this.bandwidth = this.playlists.bandwidth; | 128 | this.bandwidth = this.playlists.bandwidth; |
129 | selectedPlaylist = this.selectPlaylist(); | 129 | selectedPlaylist = this.selectPlaylist(); |
130 | newBitrate = selectedPlaylist.attributes && selectedPlaylist.attributes.BANDWIDTH; | 130 | newBitrate = selectedPlaylist.attributes && |
131 | segmentDuration = oldMediaPlaylist.segments[this.mediaIndex].duration || | 131 | selectedPlaylist.attributes.BANDWIDTH; |
132 | oldMediaPlaylist.targetDuration; | 132 | segmentDuration = oldMediaPlaylist.segments && |
133 | oldMediaPlaylist.segments[this.mediaIndex].duration || | ||
134 | oldMediaPlaylist.targetDuration; | ||
133 | 135 | ||
134 | segmentDlTime = (segmentDuration * newBitrate) / this.bandwidth; | 136 | segmentDlTime = (segmentDuration * newBitrate) / this.bandwidth; |
135 | 137 | ... | ... |
-
Please register or sign in to post a comment