Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
videojs-contrib-hls
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
1fcab4ef
authored
2014-10-29 19:36:38 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Make sure that segments attribute exists.
1 parent
173a40ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
1fcab4e
...
...
@@ -127,9 +127,11 @@ videojs.Hls.prototype.handleSourceOpen = function() {
oldMediaPlaylist
=
this
.
playlists
.
media
();
this
.
bandwidth
=
this
.
playlists
.
bandwidth
;
selectedPlaylist
=
this
.
selectPlaylist
();
newBitrate
=
selectedPlaylist
.
attributes
&&
selectedPlaylist
.
attributes
.
BANDWIDTH
;
segmentDuration
=
oldMediaPlaylist
.
segments
[
this
.
mediaIndex
].
duration
||
oldMediaPlaylist
.
targetDuration
;
newBitrate
=
selectedPlaylist
.
attributes
&&
selectedPlaylist
.
attributes
.
BANDWIDTH
;
segmentDuration
=
oldMediaPlaylist
.
segments
&&
oldMediaPlaylist
.
segments
[
this
.
mediaIndex
].
duration
||
oldMediaPlaylist
.
targetDuration
;
segmentDlTime
=
(
segmentDuration
*
newBitrate
)
/
this
.
bandwidth
;
...
...
Please
register
or
sign in
to post a comment