Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
tf committed Jan 25, 2021
1 parent 8ca2f39 commit 2e96945
Show file tree
Hide file tree
Showing 5 changed files with 935 additions and 793 deletions.
Binary file modified dist/video-js-7.11.2.zip
Binary file not shown.
53 changes: 44 additions & 9 deletions dist/video.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -40133,24 +40133,36 @@ var comparePlaylistResolution = function comparePlaylistResolution(left, right)
/**
* Chooses the appropriate media playlist based on bandwidth and player size
*
* @param {Object} master
* @param {Object} settings
* Object of information required to use this selector
* @param {Object} settings.master
* Object representation of the master manifest
* @param {number} playerBandwidth
* @param {number} settings.bandwidth
* Current calculated bandwidth of the player
* @param {number} playerWidth
* @param {number} settings.playerWidth
* Current width of the player element (should account for the device pixel ratio)
* @param {number} playerHeight
* @param {number} settings.playerHeight
* Current height of the player element (should account for the device pixel ratio)
* @param {boolean} limitRenditionByPlayerDimensions
* @param {number} settings.playerObjectFit
* Current value of the video element's object-fit CSS property. Allows taking into
* account that the video might be scaled up to cover the media element when selecting
* media playlists based on player size.
* @param {boolean} settings.limitRenditionByPlayerDimensions
* True if the player width and height should be used during the selection, false otherwise
* @return {Playlist} the highest bitrate playlist less than the
* currently detected bandwidth, accounting for some amount of
* bandwidth variance
*/


var simpleSelector = function simpleSelector(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions) {
// If we end up getting called before `master` is available, exit early
var simpleSelector = function simpleSelector(settings) {
var master = settings.master,
playerBandwidth = settings.bandwidth,
playerWidth = settings.playerWidth,
playerHeight = settings.playerHeight,
playerObjectFit = settings.playerObjectFit,
limitRenditionByPlayerDimensions = settings.limitRenditionByPlayerDimensions; // If we end up getting called before `master` is available, exit early

if (!master) {
return;
}
Expand Down Expand Up @@ -40256,6 +40268,15 @@ var simpleSelector = function simpleSelector(master, playerBandwidth, playerWidt

if (!resolutionBestRep) {
resolutionPlusOneList = haveResolution.filter(function (rep) {
if (playerObjectFit === 'cover') {
// video will be scaled up to cover the player. We need to
// make sure rendition is at least as wide and as high as the
// player.
return rep.width > playerWidth && rep.height > playerHeight;
} // video will be scaled down to fit inside the player soon as
// its resolution exceeds player size in at least one dimension.


return rep.width > playerWidth || rep.height > playerHeight;
}); // find all the variants have the same smallest resolution

Expand Down Expand Up @@ -40308,7 +40329,14 @@ var simpleSelector = function simpleSelector(master, playerBandwidth, playerWidt

var lastBandwidthSelector = function lastBandwidthSelector() {
var pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;
return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions);
return simpleSelector({
master: this.playlists.master,
bandwidth: this.systemBandwidth,
playerWidth: parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio,
playerHeight: parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio,
playerObjectFit: safeGetComputedStyle(this.tech_.el(), 'objectFit'),
limitRenditionByPlayerDimensions: this.limitRenditionByPlayerDimensions
});
};
/**
* Chooses the appropriate media playlist based on an
Expand Down Expand Up @@ -40341,7 +40369,14 @@ var movingAverageBandwidthSelector = function movingAverageBandwidthSelector(dec
}

average = decay * this.systemBandwidth + (1 - decay) * average;
return simpleSelector(this.playlists.master, average, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions);
return simpleSelector({
master: this.playlists.master,
bandwidth: average,
playerWidth: parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio,
playerHeight: parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio,
playerObjectFit: safeGetComputedStyle(this.tech_.el(), 'objectFit'),
limitRenditionByPlayerDimensions: this.limitRenditionByPlayerDimensions
});
};
};
/**
Expand Down
53 changes: 44 additions & 9 deletions dist/video.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -40129,24 +40129,36 @@ var comparePlaylistResolution = function comparePlaylistResolution(left, right)
/**
* Chooses the appropriate media playlist based on bandwidth and player size
*
* @param {Object} master
* @param {Object} settings
* Object of information required to use this selector
* @param {Object} settings.master
* Object representation of the master manifest
* @param {number} playerBandwidth
* @param {number} settings.bandwidth
* Current calculated bandwidth of the player
* @param {number} playerWidth
* @param {number} settings.playerWidth
* Current width of the player element (should account for the device pixel ratio)
* @param {number} playerHeight
* @param {number} settings.playerHeight
* Current height of the player element (should account for the device pixel ratio)
* @param {boolean} limitRenditionByPlayerDimensions
* @param {number} settings.playerObjectFit
* Current value of the video element's object-fit CSS property. Allows taking into
* account that the video might be scaled up to cover the media element when selecting
* media playlists based on player size.
* @param {boolean} settings.limitRenditionByPlayerDimensions
* True if the player width and height should be used during the selection, false otherwise
* @return {Playlist} the highest bitrate playlist less than the
* currently detected bandwidth, accounting for some amount of
* bandwidth variance
*/


var simpleSelector = function simpleSelector(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions) {
// If we end up getting called before `master` is available, exit early
var simpleSelector = function simpleSelector(settings) {
var master = settings.master,
playerBandwidth = settings.bandwidth,
playerWidth = settings.playerWidth,
playerHeight = settings.playerHeight,
playerObjectFit = settings.playerObjectFit,
limitRenditionByPlayerDimensions = settings.limitRenditionByPlayerDimensions; // If we end up getting called before `master` is available, exit early

if (!master) {
return;
}
Expand Down Expand Up @@ -40252,6 +40264,15 @@ var simpleSelector = function simpleSelector(master, playerBandwidth, playerWidt

if (!resolutionBestRep) {
resolutionPlusOneList = haveResolution.filter(function (rep) {
if (playerObjectFit === 'cover') {
// video will be scaled up to cover the player. We need to
// make sure rendition is at least as wide and as high as the
// player.
return rep.width > playerWidth && rep.height > playerHeight;
} // video will be scaled down to fit inside the player soon as
// its resolution exceeds player size in at least one dimension.


return rep.width > playerWidth || rep.height > playerHeight;
}); // find all the variants have the same smallest resolution

Expand Down Expand Up @@ -40304,7 +40325,14 @@ var simpleSelector = function simpleSelector(master, playerBandwidth, playerWidt

var lastBandwidthSelector = function lastBandwidthSelector() {
var pixelRatio = this.useDevicePixelRatio ? window$1.devicePixelRatio || 1 : 1;
return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions);
return simpleSelector({
master: this.playlists.master,
bandwidth: this.systemBandwidth,
playerWidth: parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio,
playerHeight: parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio,
playerObjectFit: safeGetComputedStyle(this.tech_.el(), 'objectFit'),
limitRenditionByPlayerDimensions: this.limitRenditionByPlayerDimensions
});
};
/**
* Chooses the appropriate media playlist based on an
Expand Down Expand Up @@ -40337,7 +40365,14 @@ var movingAverageBandwidthSelector = function movingAverageBandwidthSelector(dec
}

average = decay * this.systemBandwidth + (1 - decay) * average;
return simpleSelector(this.playlists.master, average, parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio, this.limitRenditionByPlayerDimensions);
return simpleSelector({
master: this.playlists.master,
bandwidth: average,
playerWidth: parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10) * pixelRatio,
playerHeight: parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10) * pixelRatio,
playerObjectFit: safeGetComputedStyle(this.tech_.el(), 'objectFit'),
limitRenditionByPlayerDimensions: this.limitRenditionByPlayerDimensions
});
};
};
/**
Expand Down
Loading

0 comments on commit 2e96945

Please sign in to comment.