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
91a1a861
authored
2014-10-30 15:25:15 -0400
by
Gary Katsevman
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Don't downshift in smart shifting.
1 parent
4b0e7317
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
91a1a86
...
...
@@ -109,7 +109,7 @@ videojs.Hls.prototype.handleSourceOpen = function() {
this
.
playlists
=
new
videojs
.
Hls
.
PlaylistLoader
(
this
.
src_
,
settings
.
withCredentials
);
this
.
playlists
.
on
(
'loadedmetadata'
,
videojs
.
bind
(
this
,
function
()
{
var
selectedPlaylist
,
loaderHandler
,
newBitrate
,
segmentDuration
,
var
selectedPlaylist
,
loaderHandler
,
oldBitrate
,
newBitrate
,
segmentDuration
,
segmentDlTime
,
setupEvents
,
threshold
;
setupEvents
=
function
()
{
...
...
@@ -127,8 +127,10 @@ videojs.Hls.prototype.handleSourceOpen = function() {
oldMediaPlaylist
=
this
.
playlists
.
media
();
this
.
bandwidth
=
this
.
playlists
.
bandwidth
;
selectedPlaylist
=
this
.
selectPlaylist
();
oldBitrate
=
oldMediaPlaylist
.
attributes
&&
oldMediaPlaylist
.
attributes
.
BANDWIDTH
||
0
;
newBitrate
=
selectedPlaylist
.
attributes
&&
selectedPlaylist
.
attributes
.
BANDWIDTH
;
selectedPlaylist
.
attributes
.
BANDWIDTH
||
0
;
segmentDuration
=
oldMediaPlaylist
.
segments
&&
oldMediaPlaylist
.
segments
[
this
.
mediaIndex
].
duration
||
oldMediaPlaylist
.
targetDuration
;
...
...
@@ -143,7 +145,7 @@ videojs.Hls.prototype.handleSourceOpen = function() {
// request which is a somewhat small file.
threshold
=
10
;
if
(
segmentDlTime
<=
threshold
)
{
if
(
newBitrate
>
oldBitrate
&&
segmentDlTime
<=
threshold
)
{
this
.
playlists
.
media
(
selectedPlaylist
);
loaderHandler
=
videojs
.
bind
(
this
,
function
()
{
setupEvents
.
call
(
this
);
...
...
Please
register
or
sign in
to post a comment