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
dcd06fd7
authored
2016-03-11 15:37:01 -0500
by
jrivera
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added a null check. closes #581
1 parent
5ee6cc06
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
src/videojs-contrib-hls.js
test/videojs-contrib-hls.test.js
src/videojs-contrib-hls.js
View file @
dcd06fd
...
...
@@ -323,6 +323,7 @@ const 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-contrib-hls.test.js
View file @
dcd06fd
...
...
@@ -777,6 +777,13 @@ QUnit.test('always returns an empty buffered region when there are no SourceBuff
QUnit
.
equal
(
this
.
player
.
tech_
.
hls
.
findBufferedRange_
().
length
,
0
,
'empty TimeRanges returned'
);
// Simulate the condition with no media source
delete
this
.
player
.
hls
.
mediaSource
.
mediaSource_
;
QUnit
.
equal
(
this
.
player
.
tech_
.
hls
.
findBufferedRange_
().
length
,
0
,
'empty TimeRanges returned'
);
});
QUnit
.
test
(
'finds the correct buffered region based on currentTime'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment