Minor style changes to rendition selection algorithm
Showing
1 changed file
with
11 additions
and
13 deletions
... | @@ -712,19 +712,17 @@ videojs.HlsHandler.prototype.selectPlaylist = function () { | ... | @@ -712,19 +712,17 @@ 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 | // reference to the previous variant for the next loop | 718 | // If we still haven't found a good match keep a |
719 | // iteration | 719 | // reference to the previous variant for the next loop |
720 | 720 | // iteration | |
721 | // By only saving variants if they are smaller than the | 721 | |
722 | // previously saved variant, we ensure that we also pick | 722 | // By only saving variants if they are smaller than the |
723 | // the highest bandwidth variant that is just-larger-than | 723 | // previously saved variant, we ensure that we also pick |
724 | // the video player | 724 | // the highest bandwidth variant that is just-larger-than |
725 | if(!resolutionPlusOne || | 725 | // the video player |
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