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
32a44186
authored
2014-10-27 18:44:21 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fixup and add test for switching
1 parent
1af2580f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
test/videojs-hls_test.js
test/videojs-hls_test.js
View file @
32a4418
...
...
@@ -349,6 +349,9 @@ test('downloads media playlists after loading the master', function() {
openMediaSource
(
player
);
standardXHRResponse
(
requests
[
0
]);
// set bandwidth to a high number, so, we don't switch;
player
.
hls
.
bandwidth
=
500000
;
standardXHRResponse
(
requests
[
1
]);
standardXHRResponse
(
requests
[
2
]);
...
...
@@ -365,6 +368,37 @@ test('downloads media playlists after loading the master', function() {
'first segment requested'
);
});
test
(
'downloads a second media playlist before playback'
,
function
()
{
player
.
src
({
src
:
'manifest/master.m3u8'
,
type
:
'application/vnd.apple.mpegurl'
});
openMediaSource
(
player
);
standardXHRResponse
(
requests
[
0
]);
player
.
hls
.
bandwidth
=
0
;
standardXHRResponse
(
requests
[
1
]);
standardXHRResponse
(
requests
[
2
]);
standardXHRResponse
(
requests
[
3
]);
strictEqual
(
requests
[
0
].
url
,
'manifest/master.m3u8'
,
'master playlist requested'
);
strictEqual
(
requests
[
1
].
url
,
window
.
location
.
origin
+
window
.
location
.
pathname
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
+
'/manifest/media.m3u8'
,
'media playlist requested'
);
strictEqual
(
requests
[
2
].
url
,
window
.
location
.
origin
+
window
.
location
.
pathname
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
+
'/manifest/media1.m3u8'
,
'media playlist requested'
);
strictEqual
(
requests
[
3
].
url
,
window
.
location
.
origin
+
window
.
location
.
pathname
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
+
'/manifest/00001.ts'
,
'first segment requested'
);
});
test
(
'timeupdates do not check to fill the buffer until a media playlist is ready'
,
function
()
{
player
.
src
({
src
:
'manifest/media.m3u8'
,
...
...
Please
register
or
sign in
to post a comment