v3.5.8 deployed
This commit is contained in:
143
dist/plyr.polyfilled.js
vendored
143
dist/plyr.polyfilled.js
vendored
@ -7456,12 +7456,14 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
return Number(source.getAttribute('size'));
|
||||
}).filter(Boolean);
|
||||
},
|
||||
extend: function extend() {
|
||||
setup: function setup() {
|
||||
if (!this.isHTML5) {
|
||||
return;
|
||||
}
|
||||
|
||||
var player = this; // Set aspect ratio if fixed
|
||||
var player = this; // Set speed options from config
|
||||
|
||||
player.options.speed = player.config.speed.options; // Set aspect ratio if fixed
|
||||
|
||||
if (!is$1.empty(this.config.ratio)) {
|
||||
setAspectRatio.call(player);
|
||||
@ -7552,28 +7554,6 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
};
|
||||
|
||||
// `Array.prototype.fill` method implementation
|
||||
// https://tc39.github.io/ecma262/#sec-array.prototype.fill
|
||||
var arrayFill = function fill(value /* , start = 0, end = @length */) {
|
||||
var O = toObject(this);
|
||||
var length = toLength(O.length);
|
||||
var argumentsLength = arguments.length;
|
||||
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
|
||||
var end = argumentsLength > 2 ? arguments[2] : undefined;
|
||||
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
|
||||
while (endPos > index) O[index++] = value;
|
||||
return O;
|
||||
};
|
||||
|
||||
// `Array.prototype.fill` method
|
||||
// https://tc39.github.io/ecma262/#sec-array.prototype.fill
|
||||
_export({ target: 'Array', proto: true }, {
|
||||
fill: arrayFill
|
||||
});
|
||||
|
||||
// https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables
|
||||
addToUnscopables('fill');
|
||||
|
||||
function dedupe(array) {
|
||||
if (!is$1.array(array)) {
|
||||
return array;
|
||||
@ -7593,13 +7573,6 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
return Math.abs(curr - value) < Math.abs(prev - value) ? curr : prev;
|
||||
});
|
||||
}
|
||||
function fillRange(start, end) {
|
||||
var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
||||
var len = Math.floor((end - start) / step) + 1;
|
||||
return Array(len).fill().map(function (_, idx) {
|
||||
return start + idx * step;
|
||||
});
|
||||
}
|
||||
|
||||
var defineProperty$6 = objectDefineProperty.f;
|
||||
var getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
|
||||
@ -8922,17 +8895,11 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
var type = 'speed';
|
||||
var list = this.elements.settings.panels.speed.querySelector('[role="menu"]'); // Determine options to display
|
||||
// Vimeo and YouTube limit to 0.5x-2x
|
||||
|
||||
if (this.isVimeo || this.isYouTube) {
|
||||
this.options.speed = fillRange(0.5, 2, 0.25).filter(function (s) {
|
||||
return _this8.config.speed.options.includes(s);
|
||||
});
|
||||
} else {
|
||||
this.options.speed = this.config.speed.options;
|
||||
} // Toggle the pane and tab
|
||||
var list = this.elements.settings.panels.speed.querySelector('[role="menu"]'); // Filter out invalid speeds
|
||||
|
||||
this.options.speed = this.options.speed.filter(function (o) {
|
||||
return o >= _this8.minimumSpeed && o <= _this8.maximumSpeed;
|
||||
}); // Toggle the pane and tab
|
||||
|
||||
var toggle = !is$1.empty(this.options.speed) && this.options.speed.length > 1;
|
||||
controls.toggleMenuButton.call(this, type, toggle); // Empty the menu
|
||||
@ -9976,7 +9943,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
// Sprite (for icons)
|
||||
loadSprite: true,
|
||||
iconPrefix: 'plyr',
|
||||
iconUrl: 'https://cdn.plyr.io/3.5.7/plyr.svg',
|
||||
iconUrl: 'https://cdn.plyr.io/3.5.8/plyr.svg',
|
||||
// Blank video (used to prevent errors on source change)
|
||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||
// Quality default
|
||||
@ -10260,7 +10227,13 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
portrait: false,
|
||||
title: false,
|
||||
speed: true,
|
||||
transparent: false
|
||||
transparent: false,
|
||||
// These settings require a pro or premium account to work
|
||||
sidedock: false,
|
||||
controls: false,
|
||||
// Custom settings from Plyr
|
||||
referrerPolicy: null // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
||||
|
||||
},
|
||||
// YouTube plugin
|
||||
youtube: {
|
||||
@ -12044,26 +12017,27 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
var vimeo = {
|
||||
setup: function setup() {
|
||||
var _this = this;
|
||||
var player = this; // Add embed class for responsive
|
||||
|
||||
// Add embed class for responsive
|
||||
toggleClass(this.elements.wrapper, this.config.classNames.embed, true); // Set intial ratio
|
||||
toggleClass(player.elements.wrapper, player.config.classNames.embed, true); // Set speed options from config
|
||||
|
||||
setAspectRatio.call(this); // Load the SDK if not already
|
||||
player.options.speed = player.config.speed.options; // Set intial ratio
|
||||
|
||||
setAspectRatio.call(player); // Load the SDK if not already
|
||||
|
||||
if (!is$1.object(window.Vimeo)) {
|
||||
loadScript(this.config.urls.vimeo.sdk).then(function () {
|
||||
vimeo.ready.call(_this);
|
||||
loadScript(player.config.urls.vimeo.sdk).then(function () {
|
||||
vimeo.ready.call(player);
|
||||
}).catch(function (error) {
|
||||
_this.debug.warn('Vimeo SDK (player.js) failed to load', error);
|
||||
player.debug.warn('Vimeo SDK (player.js) failed to load', error);
|
||||
});
|
||||
} else {
|
||||
vimeo.ready.call(this);
|
||||
vimeo.ready.call(player);
|
||||
}
|
||||
},
|
||||
// API Ready
|
||||
ready: function ready() {
|
||||
var _this2 = this;
|
||||
var _this = this;
|
||||
|
||||
var player = this;
|
||||
var config = player.config.vimeo; // Get Vimeo params for the iframe
|
||||
@ -12089,7 +12063,12 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
iframe.setAttribute('src', src);
|
||||
iframe.setAttribute('allowfullscreen', '');
|
||||
iframe.setAttribute('allowtransparency', '');
|
||||
iframe.setAttribute('allow', 'autoplay'); // Get poster, if already set
|
||||
iframe.setAttribute('allow', 'autoplay'); // Set the referrer policy if required
|
||||
|
||||
if (!is$1.empty(config.referrerPolicy)) {
|
||||
iframe.setAttribute('referrerPolicy', config.referrerPolicy);
|
||||
} // Get poster, if already set
|
||||
|
||||
|
||||
var poster = player.poster; // Inject the package
|
||||
|
||||
@ -12231,7 +12210,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
currentSrc = value;
|
||||
controls.setDownloadUrl.call(player);
|
||||
}).catch(function (error) {
|
||||
_this2.debug.warn(error);
|
||||
_this.debug.warn(error);
|
||||
});
|
||||
Object.defineProperty(player.media, 'currentSrc', {
|
||||
get: function get() {
|
||||
@ -12251,7 +12230,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
height = _dimensions[1];
|
||||
|
||||
player.embed.ratio = [width, height];
|
||||
setAspectRatio.call(_this2);
|
||||
setAspectRatio.call(_this);
|
||||
}); // Set autopause
|
||||
|
||||
player.embed.setAutopause(player.config.autopause).then(function (state) {
|
||||
@ -12260,7 +12239,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
player.embed.getVideoTitle().then(function (title) {
|
||||
player.config.title = title;
|
||||
ui.setTitle.call(_this2);
|
||||
ui.setTitle.call(_this);
|
||||
}); // Get current time
|
||||
|
||||
player.embed.getCurrentTime().then(function (value) {
|
||||
@ -12633,7 +12612,11 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
}); // Get available speeds
|
||||
|
||||
player.options.speed = instance.getAvailablePlaybackRates(); // Set the tabindex to avoid focus entering iframe
|
||||
var speeds = instance.getAvailablePlaybackRates(); // Filter based on config
|
||||
|
||||
player.options.speed = speeds.filter(function (s) {
|
||||
return player.config.speed.options.includes(s);
|
||||
}); // Set the tabindex to avoid focus entering iframe
|
||||
|
||||
if (player.supported.ui) {
|
||||
player.media.setAttribute('tabindex', -1);
|
||||
@ -12791,7 +12774,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
|
||||
if (this.isHTML5) {
|
||||
html5.extend.call(this);
|
||||
html5.setup.call(this);
|
||||
} else if (this.isYouTube) {
|
||||
youtube.setup.call(this);
|
||||
} else if (this.isVimeo) {
|
||||
@ -13588,7 +13571,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
value: function load() {
|
||||
var _this = this;
|
||||
|
||||
// Togglethe regular seek tooltip
|
||||
// Toggle the regular seek tooltip
|
||||
if (this.player.elements.display.seekTooltip) {
|
||||
this.player.elements.display.seekTooltip.hidden = this.enabled;
|
||||
}
|
||||
@ -13815,6 +13798,17 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
});
|
||||
this.player.elements.wrapper.appendChild(this.elements.scrubbing.container);
|
||||
}
|
||||
}, {
|
||||
key: "destroy",
|
||||
value: function destroy() {
|
||||
if (this.elements.thumb.container) {
|
||||
this.elements.thumb.container.remove();
|
||||
}
|
||||
|
||||
if (this.elements.scrubbing.container) {
|
||||
this.elements.scrubbing.container.remove();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "showImageAtCurrentTime",
|
||||
value: function showImageAtCurrentTime() {
|
||||
@ -14060,7 +14054,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}, {
|
||||
key: "determineContainerAutoSizing",
|
||||
value: function determineContainerAutoSizing() {
|
||||
if (this.elements.thumb.imageContainer.clientHeight > 20) {
|
||||
if (this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) {
|
||||
// This will prevent auto sizing in this.setThumbContainerSizeAndPos()
|
||||
this.sizeSpecifiedInCSS = true;
|
||||
}
|
||||
@ -14073,6 +14067,13 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
var thumbWidth = Math.floor(this.thumbContainerHeight * this.thumbAspectRatio);
|
||||
this.elements.thumb.imageContainer.style.height = "".concat(this.thumbContainerHeight, "px");
|
||||
this.elements.thumb.imageContainer.style.width = "".concat(thumbWidth, "px");
|
||||
} else if (this.elements.thumb.imageContainer.clientHeight > 20 && this.elements.thumb.imageContainer.clientWidth < 20) {
|
||||
var _thumbWidth = Math.floor(this.elements.thumb.imageContainer.clientHeight * this.thumbAspectRatio);
|
||||
|
||||
this.elements.thumb.imageContainer.style.width = "".concat(_thumbWidth, "px");
|
||||
} else if (this.elements.thumb.imageContainer.clientHeight < 20 && this.elements.thumb.imageContainer.clientWidth > 20) {
|
||||
var thumbHeight = Math.floor(this.elements.thumb.imageContainer.clientWidth / this.thumbAspectRatio);
|
||||
this.elements.thumb.imageContainer.style.height = "".concat(thumbHeight, "px");
|
||||
}
|
||||
|
||||
this.setThumbContainerPos();
|
||||
@ -14171,6 +14172,11 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
height = _fitRatio2.height;
|
||||
|
||||
return height;
|
||||
} // If css is used this needs to return the css height for sprites to work (see setImageSizeAndOffset)
|
||||
|
||||
|
||||
if (this.sizeSpecifiedInCSS) {
|
||||
return this.elements.thumb.imageContainer.clientHeight;
|
||||
}
|
||||
|
||||
return Math.floor(this.player.media.clientWidth / this.thumbAspectRatio / 4);
|
||||
@ -14320,11 +14326,22 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
if (_this2.isHTML5) {
|
||||
_this2.media.load();
|
||||
} // Reload thumbnails
|
||||
} // Update previewThumbnails config & reload plugin
|
||||
|
||||
|
||||
if (_this2.previewThumbnails) {
|
||||
_this2.previewThumbnails.load();
|
||||
if (!is$1.empty(input.previewThumbnails)) {
|
||||
Object.assign(_this2.config.previewThumbnails, input.previewThumbnails); // Cleanup previewThumbnails plugin if it was loaded
|
||||
|
||||
if (_this2.previewThumbnails && _this2.previewThumbnails.loaded) {
|
||||
_this2.previewThumbnails.destroy();
|
||||
|
||||
_this2.previewThumbnails = null;
|
||||
} // Create new instance if it is still enabled
|
||||
|
||||
|
||||
if (_this2.config.previewThumbnails.enabled) {
|
||||
_this2.previewThumbnails = new PreviewThumbnails(_this2);
|
||||
}
|
||||
} // Update the fullscreen support
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user