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
6dabe4c1
authored
2014-10-27 18:16:54 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Request a new playlist based on initial playlist
1 parent
d55d72d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
6dabe4c
...
...
@@ -104,11 +104,31 @@ videojs.Hls.prototype.handleSourceOpen = function() {
this
.
playlists
=
new
videojs
.
Hls
.
PlaylistLoader
(
this
.
src_
,
settings
.
withCredentials
);
this
.
playlists
.
on
(
'loadedmetadata'
,
videojs
.
bind
(
this
,
function
()
{
var
selectedPlaylist
,
loaderHandler
;
oldMediaPlaylist
=
this
.
playlists
.
media
();
// periodically check if new data needs to be downloaded or
// buffered data should be appended to the source buffer
if
(
this
.
bandwidth
!==
this
.
playlists
.
bandwidth
)
{
this
.
bandwidth
=
this
.
playlists
.
bandwidth
;
selectedPlaylist
=
this
.
selectPlaylist
();
if
(
selectedPlaylist
===
oldMediaPlaylist
)
{
this
.
fillBuffer
();
}
else
{
this
.
playlists
.
media
(
selectedPlaylist
);
loaderHandler
=
videojs
.
bind
(
this
,
function
()
{
this
.
fillBuffer
();
this
.
playlists
.
off
(
'loadedplaylist'
,
loaderHandler
);
});
this
.
playlists
.
on
(
'loadedplaylist'
,
loaderHandler
);
}
}
else
{
this
.
fillBuffer
();
}
player
.
on
(
'timeupdate'
,
videojs
.
bind
(
this
,
this
.
fillBuffer
));
player
.
on
(
'timeupdate'
,
videojs
.
bind
(
this
,
this
.
drainBuffer
));
player
.
on
(
'waiting'
,
videojs
.
bind
(
this
,
this
.
drainBuffer
));
...
...
Please
register
or
sign in
to post a comment