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
5e255431
authored
2014-10-29 19:27:14 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
A playlist loader setBandwidthByXhr. Fix a test.
1 parent
45749f62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
src/playlist-loader.js
test/videojs-hls_test.js
src/playlist-loader.js
View file @
5e25543
...
...
@@ -58,7 +58,7 @@
haveMetadata
=
function
(
error
,
xhr
,
url
)
{
var
parser
,
refreshDelay
,
update
;
loader
.
bandwidth
=
request
&&
request
.
bandwidth
||
xhr
&&
xhr
.
bandwidth
;
loader
.
setBandwidthByXHR
(
request
||
xhr
)
;
// any in-flight request is now finished
request
=
null
;
...
...
@@ -202,6 +202,10 @@
});
};
loader
.
setBandwidthByXHR
=
function
(
xhr
)
{
loader
.
bandwidth
=
xhr
.
bandwidth
;
};
// live playlist staleness timeout
loader
.
on
(
'mediaupdatetimeout'
,
function
()
{
if
(
loader
.
state
!==
'HAVE_METADATA'
)
{
...
...
test/videojs-hls_test.js
View file @
5e25543
...
...
@@ -377,8 +377,10 @@ test('downloads a second media playlist before playback, if bandwidth is high',
standardXHRResponse
(
requests
[
0
]);
player
.
hls
.
bandwidth
=
0
;
requests
[
1
].
requestTime
=
(
new
Date
())
-
100
;
player
.
hls
.
playlists
.
setBandwidthByXHR
=
function
()
{
player
.
hls
.
playlists
.
bandwidth
=
100000
;
};
standardXHRResponse
(
requests
[
1
]);
standardXHRResponse
(
requests
[
2
]);
standardXHRResponse
(
requests
[
3
]);
...
...
Please
register
or
sign in
to post a comment