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
f91ca616
authored
2014-10-30 15:46:01 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add upshift and downshift tests
1 parent
91a1a861
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
4 deletions
test/videojs-hls_test.js
test/videojs-hls_test.js
View file @
f91ca61
...
...
@@ -368,7 +368,7 @@ test('downloads media playlists after loading the master', function() {
'first segment requested'
);
});
test
(
'
downloads a second media playlist before playback, if
bandwidth is high'
,
function
()
{
test
(
'
upshift if initial
bandwidth is high'
,
function
()
{
player
.
src
({
src
:
'manifest/master.m3u8'
,
type
:
'application/vnd.apple.mpegurl'
...
...
@@ -378,11 +378,12 @@ test('downloads a second media playlist before playback, if bandwidth is high',
standardXHRResponse
(
requests
[
0
]);
player
.
hls
.
playlists
.
setBandwidth
=
function
()
{
player
.
hls
.
playlists
.
bandwidth
=
100000
;
player
.
hls
.
playlists
.
bandwidth
=
100000
0000
;
};
standardXHRResponse
(
requests
[
1
]);
standardXHRResponse
(
requests
[
2
]);
standardXHRResponse
(
requests
[
3
]);
strictEqual
(
requests
[
0
].
url
,
'manifest/master.m3u8'
,
'master playlist requested'
);
...
...
@@ -394,13 +395,49 @@ test('downloads a second media playlist before playback, if bandwidth is high',
strictEqual
(
requests
[
2
].
url
,
window
.
location
.
origin
+
window
.
location
.
pathname
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
+
'/manifest/media
1
.m3u8'
,
'/manifest/media
3
.m3u8'
,
'media playlist requested'
);
strictEqual
(
requests
[
3
].
url
,
window
.
location
.
origin
+
window
.
location
.
pathname
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
+
'/manifest/media1-00001.ts'
,
'/manifest/media3-00001.ts'
,
'first segment requested'
);
});
test
(
'dont downshift if bandwidth is low'
,
function
()
{
player
.
src
({
src
:
'manifest/master.m3u8'
,
type
:
'application/vnd.apple.mpegurl'
});
openMediaSource
(
player
);
standardXHRResponse
(
requests
[
0
]);
player
.
hls
.
playlists
.
setBandwidth
=
function
()
{
player
.
hls
.
playlists
.
bandwidth
=
100
;
};
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/media-00001.ts'
,
'first segment requested'
);
strictEqual
(
requests
[
3
].
url
,
window
.
location
.
origin
+
window
.
location
.
pathname
.
split
(
'/'
).
slice
(
0
,
-
1
).
join
(
'/'
)
+
'/manifest/media1.m3u8'
,
'media playlist requested'
);
});
test
(
'timeupdates do not check to fill the buffer until a media playlist is ready'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment