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
b416adc6
authored
2014-10-27 13:57:08 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add a cancelKeyXhr akin to cancelSegmentXhr
1 parent
0154b51f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
b416adc
...
...
@@ -138,8 +138,7 @@ videojs.Hls.prototype.handleSourceOpen = function() {
this
.
playlists
.
on
(
'mediachange'
,
videojs
.
bind
(
this
,
function
()
{
// abort outstanding key requests and check if new keys need to be retrieved
if
(
keyXhr
)
{
keyXhr
.
abort
();
keyXhr
=
null
;
this
.
cancelKeyXhr
();
this
.
fetchKeys
(
this
.
playlists
.
media
(),
this
.
mediaIndex
);
}
...
...
@@ -200,8 +199,7 @@ videojs.Hls.prototype.setCurrentTime = function(currentTime) {
// fetch new encryption keys, if necessary
if
(
keyXhr
)
{
keyXhr
.
aborted
=
true
;
keyXhr
.
abort
();
keyXhr
=
null
;
this
.
cancelKeyXhr
();
this
.
fetchKeys
(
this
.
playlists
.
media
(),
this
.
mediaIndex
);
}
...
...
@@ -241,15 +239,19 @@ videojs.Hls.prototype.updateDuration = function(playlist) {
*/
videojs
.
Hls
.
prototype
.
resetSrc_
=
function
()
{
this
.
cancelSegmentXhr
();
this
.
cancelKeyXhr
();
if
(
this
.
sourceBuffer
)
{
this
.
sourceBuffer
.
abort
();
}
};
videojs
.
Hls
.
prototype
.
cancelKeyXhr
=
function
()
{
if
(
keyXhr
)
{
keyXhr
.
onreadystatechange
=
null
;
keyXhr
.
abort
();
keyXhr
=
null
;
}
if
(
this
.
sourceBuffer
)
{
this
.
sourceBuffer
.
abort
();
}
};
videojs
.
Hls
.
prototype
.
cancelSegmentXhr
=
function
()
{
...
...
Please
register
or
sign in
to post a comment