Minor style changes to rendition selection algorithm
Showing
1 changed file
with
4 additions
and
6 deletions
... | @@ -712,9 +712,10 @@ videojs.HlsHandler.prototype.selectPlaylist = function () { | ... | @@ -712,9 +712,10 @@ videojs.HlsHandler.prototype.selectPlaylist = function () { |
712 | // if both dimensions are less than the player use the | 712 | // if both dimensions are less than the player use the |
713 | // previous (next-largest) variant | 713 | // previous (next-largest) variant |
714 | break; | 714 | break; |
715 | } | 715 | } else if (!resolutionPlusOne || |
716 | 716 | (variant.attributes.RESOLUTION.width < resolutionPlusOne.attributes.RESOLUTION.width && | |
717 | // If we still haven't found a good match so keep a | 717 | variant.attributes.RESOLUTION.height < resolutionPlusOne.attributes.RESOLUTION.height)) { |
718 | // If we still haven't found a good match keep a | ||
718 | // reference to the previous variant for the next loop | 719 | // reference to the previous variant for the next loop |
719 | // iteration | 720 | // iteration |
720 | 721 | ||
... | @@ -722,9 +723,6 @@ videojs.HlsHandler.prototype.selectPlaylist = function () { | ... | @@ -722,9 +723,6 @@ videojs.HlsHandler.prototype.selectPlaylist = function () { |
722 | // previously saved variant, we ensure that we also pick | 723 | // previously saved variant, we ensure that we also pick |
723 | // the highest bandwidth variant that is just-larger-than | 724 | // the highest bandwidth variant that is just-larger-than |
724 | // the video player | 725 | // the video player |
725 | if(!resolutionPlusOne || | ||
726 | (variant.attributes.RESOLUTION.width < resolutionPlusOne.attributes.RESOLUTION.width && | ||
727 | variant.attributes.RESOLUTION.height < resolutionPlusOne.attributes.RESOLUTION.height)) { | ||
728 | resolutionPlusOne = variant; | 726 | resolutionPlusOne = variant; |
729 | } | 727 | } |
730 | } | 728 | } | ... | ... |
-
Please register or sign in to post a comment