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
5662e402
authored
2014-10-02 15:12:13 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge pull request #166 from videojs/responsetext-errors
return responseText in errors
2 parents
079d7092
394b14b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
src/playlist-loader.js
test/playlist-loader_test.js
src/playlist-loader.js
View file @
5662e40
...
...
@@ -65,6 +65,7 @@
loader
.
error
=
{
status
:
xhr
.
status
,
message
:
'HLS playlist request error at URL: '
+
url
,
responseText
:
xhr
.
responseText
,
code
:
(
xhr
.
status
>=
500
)
?
4
:
2
};
return
loader
.
trigger
(
'error'
);
...
...
@@ -226,6 +227,7 @@
loader
.
error
=
{
status
:
this
.
status
,
message
:
'HLS playlist request error at URL: '
+
srcUrl
,
responseText
:
this
.
responseText
,
code
:
2
// MEDIA_ERR_NETWORK
};
return
loader
.
trigger
(
'error'
);
...
...
test/playlist-loader_test.js
View file @
5662e40
...
...
@@ -240,6 +240,7 @@
test
(
'emits an error if a media refresh fails'
,
function
()
{
var
errors
=
0
,
errorResponseText
=
'custom error message'
,
loader
=
new
videojs
.
Hls
.
PlaylistLoader
(
'live.m3u8'
);
loader
.
on
(
'error'
,
function
()
{
...
...
@@ -251,10 +252,11 @@
'#EXTINF:10,\n'
+
'0.ts\n'
);
clock
.
tick
(
10
*
1000
);
// trigger a refresh
requests
.
pop
().
respond
(
500
);
requests
.
pop
().
respond
(
500
,
null
,
errorResponseText
);
strictEqual
(
errors
,
1
,
'emitted an error'
);
strictEqual
(
loader
.
error
.
status
,
500
,
'captured the status code'
);
strictEqual
(
loader
.
error
.
responseText
,
errorResponseText
,
'captured the responseText'
);
});
test
(
'switches media playlists when requested'
,
function
()
{
...
...
Please
register
or
sign in
to post a comment