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
fe517c0e
authored
2016-03-03 17:05:19 -0500
by
jforbes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added an extra null check for mediaSource
1 parent
6a9433a9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
src/videojs-hls.js
test/videojs-hls_test.js
src/videojs-hls.js
View file @
fe517c0
...
...
@@ -892,6 +892,7 @@ var filterBufferedRanges = function(predicate) {
// report a fully empty buffer until SourceBuffers have been created
// which is after a segment has been loaded and transmuxed.
if
(
!
this
.
mediaSource
||
!
this
.
mediaSource
.
mediaSource_
||
!
this
.
mediaSource
.
mediaSource_
.
sourceBuffers
.
length
)
{
return
videojs
.
createTimeRanges
([]);
}
...
...
test/videojs-hls_test.js
View file @
fe517c0
...
...
@@ -739,6 +739,13 @@ test('always returns an empty buffered region when there are no SourceBuffers',
equal
(
player
.
tech_
.
hls
.
findBufferedRange_
().
length
,
0
,
'empty TimeRanges returned'
);
// Simulate the condition with no media source
player
.
hls
.
mediaSource
.
mediaSource_
=
undefined
;
equal
(
player
.
tech_
.
hls
.
findBufferedRange_
().
length
,
0
,
'empty TimeRanges returned'
);
});
test
(
'finds the correct buffered region based on currentTime'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment