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
b653e0ce
authored
2015-12-09 18:57:48 -0500
by
jrivera
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
When loading a segment, use the time we spend on an XHR to remove data in buffer before seekable
1 parent
9eb8c8fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
b653e0c
...
...
@@ -982,7 +982,26 @@ videojs.HlsHandler.prototype.blacklistCurrentPlaylist_ = function(error) {
videojs
.
HlsHandler
.
prototype
.
loadSegment
=
function
(
segmentInfo
)
{
var
self
=
this
,
segment
=
segmentInfo
.
playlist
.
segments
[
segmentInfo
.
mediaIndex
];
segment
=
segmentInfo
.
playlist
.
segments
[
segmentInfo
.
mediaIndex
],
removeToTime
=
0
,
seekable
=
this
.
seekable
();
// Chrome has a hard limit of 150mb of buffer and a very conservative "garbage collector"
// We manually clear out the old buffer to ensure we don't trigger the QuotaExceeded error
// on the source buffer during subsequent appends
if
(
this
.
sourceBuffer
)
{
// If we have a seekable range use that as the limit for what can be removed safely
// otherwise remove anything older than 1 minute before the current play head
if
(
seekable
.
length
&&
seekable
.
start
(
0
)
>
0
)
{
removeToTime
=
seekable
.
start
(
0
);
}
else
{
removeToTime
=
this
.
tech_
.
currentTime
()
-
60
;
}
if
(
removeToTime
>
0
)
{
this
.
sourceBuffer
.
remove
(
0
,
removeToTime
);
}
}
// if the segment is encrypted, request the key
if
(
segment
.
key
)
{
...
...
Please
register
or
sign in
to post a comment