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
8d78a902
authored
2014-03-17 15:24:05 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix 'moves to next segment if network error'
1 parent
3bccfa73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
test/videojs-hls_test.js
test/videojs-hls_test.js
View file @
8d78a90
...
...
@@ -366,13 +366,10 @@ asyncTest('selects a playlist after segment downloads', function() {
player
.
trigger
(
'timeupdate'
);
});
t
est
(
'moves to the next segment if there is a network error'
,
function
()
{
asyncT
est
(
'moves to the next segment if there is a network error'
,
function
()
{
var
mediaIndex
;
player
.
hls
(
'manifest/master.m3u8'
);
videojs
.
mediaSources
[
player
.
currentSrc
()].
trigger
({
type
:
'sourceopen'
});
player
.
on
(
'loadedmanifest'
,
function
()
{
// fail the next segment request
window
.
XMLHttpRequest
=
function
()
{
this
.
open
=
function
()
{};
...
...
@@ -380,12 +377,20 @@ test('moves to the next segment if there is a network error', function() {
this
.
readyState
=
4
;
this
.
status
=
400
;
this
.
onreadystatechange
();
strictEqual
(
mediaIndex
+
1
,
player
.
hls
.
mediaIndex
,
'media index is incremented'
);
start
();
};
};
mediaIndex
=
player
.
hls
.
mediaIndex
;
player
.
trigger
(
'timeupdate'
);
});
strictEqual
(
mediaIndex
+
1
,
player
.
hls
.
mediaIndex
,
'media index is incremented'
);
player
.
hls
(
'manifest/master.m3u8'
);
videojs
.
mediaSources
[
player
.
currentSrc
()].
trigger
({
type
:
'sourceopen'
});
});
test
(
'updates the duration after switching playlists'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment