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
e4a526c4
authored
2016-01-18 12:10:37 -0500
by
jrivera
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Minor style changes to rendition selection algorithm
1 parent
3a9f92ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
src/videojs-hls.js
src/videojs-hls.js
View file @
e4a526c
...
...
@@ -712,19 +712,17 @@ videojs.HlsHandler.prototype.selectPlaylist = function () {
// if both dimensions are less than the player use the
// previous (next-largest) variant
break
;
}
// If we still haven't found a good match so keep a
// reference to the previous variant for the next loop
// iteration
// By only saving variants if they are smaller than the
// previously saved variant, we ensure that we also pick
// the highest bandwidth variant that is just-larger-than
// the video player
if
(
!
resolutionPlusOne
||
(
variant
.
attributes
.
RESOLUTION
.
width
<
resolutionPlusOne
.
attributes
.
RESOLUTION
.
width
&&
variant
.
attributes
.
RESOLUTION
.
height
<
resolutionPlusOne
.
attributes
.
RESOLUTION
.
height
))
{
}
else
if
(
!
resolutionPlusOne
||
(
variant
.
attributes
.
RESOLUTION
.
width
<
resolutionPlusOne
.
attributes
.
RESOLUTION
.
width
&&
variant
.
attributes
.
RESOLUTION
.
height
<
resolutionPlusOne
.
attributes
.
RESOLUTION
.
height
))
{
// If we still haven't found a good match keep a
// reference to the previous variant for the next loop
// iteration
// By only saving variants if they are smaller than the
// previously saved variant, we ensure that we also pick
// the highest bandwidth variant that is just-larger-than
// the video player
resolutionPlusOne
=
variant
;
}
}
...
...
Please
register
or
sign in
to post a comment