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
8b13aaa9
authored
2015-12-09 19:20:04 -0500
by
jrivera
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Added a test for calling remove on the sourceBuffer when loadSegment is called
1 parent
b653e0ce
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
test/videojs-hls_test.js
test/videojs-hls_test.js
View file @
8b13aaa
...
...
@@ -373,6 +373,39 @@ test('duration is set when the source opens after the playlist is loaded', funct
equal
(
player
.
tech_
.
hls
.
mediaSource
.
duration
,
40
,
'set the duration'
);
});
test
(
'calls `remove` on sourceBuffer to when loading a segment'
,
function
()
{
var
removes
=
[];
player
.
src
({
src
:
'manifest/master.m3u8'
,
type
:
'application/vnd.apple.mpegurl'
});
openMediaSource
(
player
);
player
.
tech_
.
hls
.
mediaSource
.
addSourceBuffer
=
function
()
{
return
new
(
videojs
.
extend
(
videojs
.
EventTarget
,
{
constructor
:
function
()
{},
abort
:
function
()
{},
buffered
:
videojs
.
createTimeRange
(),
appendBuffer
:
function
()
{},
remove
:
function
(
start
,
end
)
{
removes
.
push
([
start
,
end
]);
}
}))();
};
player
.
tech_
.
hls
.
bandwidth
=
20
e10
;
standardXHRResponse
(
requests
[
0
]);
player
.
currentTime
(
120
);
standardXHRResponse
(
requests
[
1
]);
standardXHRResponse
(
requests
[
2
]);
strictEqual
(
requests
[
0
].
url
,
'manifest/master.m3u8'
,
'master playlist requested'
);
strictEqual
(
requests
[
1
].
url
,
absoluteUrl
(
'manifest/media3.m3u8'
),
'media playlist requested'
);
equal
(
removes
.
length
,
1
,
'remove called'
);
deepEqual
(
removes
[
0
],
[
0
,
120
-
60
],
'remove called with the right range'
);
});
test
(
'codecs are passed to the source buffer'
,
function
()
{
var
codecs
=
[];
player
.
src
({
...
...
Please
register
or
sign in
to post a comment