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
34cde14a
authored
11 years ago
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Revert "fix 'selects a playlist after segment downloads'"
This reverts commit
3bccfa73
.
1 parent
8d78a902
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
31 deletions
test/videojs-hls_test.js
test/videojs-hls_test.js
View file @
34cde14
...
...
@@ -316,47 +316,18 @@ test('calculates the bandwidth after downloading a segment', function() {
'saves segment request time: '
+
player
.
hls
.
segmentXhrTime
+
's'
);
});
asyncTest
(
'selects a playlist after segment downloads'
,
function
()
{
window
.
XMLHttpRequest
=
function
()
{
this
.
open
=
function
(
method
,
url
)
{
xhrUrls
.
push
(
url
);
};
this
.
send
=
function
()
{
var
self
=
this
;
setTimeout
(
function
()
{
var
manifestName
=
(
/
(?:
.*
\/)?(
.*
)\.
m3u8/
).
exec
(
xhrUrls
.
slice
(
-
1
)[
0
]);
if
(
manifestName
)
{
manifestName
=
manifestName
[
1
];
}
self
.
responseText
=
window
.
manifests
[
manifestName
||
xhrUrls
.
slice
(
-
1
)[
0
]];
self
.
response
=
new
Uint8Array
([
1
]).
buffer
;
self
.
readyState
=
4
;
self
.
onreadystatechange
();
},
0
);
};
this
.
abort
=
function
()
{};
};
test
(
'selects a playlist after segment downloads'
,
function
()
{
var
calls
=
0
;
player
.
hls
(
'manifest/master.m3u8'
);
player
.
hls
.
selectPlaylist
=
function
()
{
calls
++
;
strictEqual
(
calls
,
1
,
'selects after the initial segment'
);
player
.
hls
.
selectPlaylist
=
function
()
{
calls
++
;
strictEqual
(
calls
,
2
,
'selects after additional segments'
);
start
();
return
player
.
hls
.
master
.
playlists
[
0
];
};
return
player
.
hls
.
master
.
playlists
[
0
];
};
videojs
.
mediaSources
[
player
.
currentSrc
()].
trigger
({
type
:
'sourceopen'
});
strictEqual
(
calls
,
1
,
'selects after the initial segment'
);
player
.
currentTime
=
function
()
{
return
1
;
};
...
...
@@ -364,6 +335,7 @@ asyncTest('selects a playlist after segment downloads', function() {
return
videojs
.
createTimeRange
(
0
,
2
);
};
player
.
trigger
(
'timeupdate'
);
strictEqual
(
calls
,
2
,
'selects after additional segments'
);
});
asyncTest
(
'moves to the next segment if there is a network error'
,
function
()
{
...
...
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment