chore: update packages and linting
This commit is contained in:
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
39
dist/plyr.js
vendored
39
dist/plyr.js
vendored
@ -1,7 +1,7 @@
|
||||
typeof navigator === "object" && (function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define('Plyr', factory) :
|
||||
(global = global || self, global.Plyr = factory());
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Plyr = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
@ -163,7 +163,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
@ -1084,7 +1084,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
var event = new CustomEvent(type, {
|
||||
bubbles: bubbles,
|
||||
detail: _objectSpread2({}, detail, {
|
||||
detail: _objectSpread2(_objectSpread2({}, detail), {}, {
|
||||
plyr: this
|
||||
})
|
||||
}); // Dispatch the event
|
||||
@ -1197,7 +1197,12 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
if (this.isVimeo && !this.config.vimeo.premium && this.supported.ui) {
|
||||
var height = 100 / this.media.offsetWidth * parseInt(window.getComputedStyle(this.media).paddingBottom, 10);
|
||||
var offset = (height - padding) / (height / 50);
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
|
||||
if (this.fullscreen.active) {
|
||||
wrapper.style.paddingBottom = null;
|
||||
} else {
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
}
|
||||
} else if (this.isHTML5) {
|
||||
wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null);
|
||||
}
|
||||
@ -1786,7 +1791,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
var attr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var text = i18n.get(key, this.config);
|
||||
|
||||
var attributes = _objectSpread2({}, attr, {
|
||||
var attributes = _objectSpread2(_objectSpread2({}, attr), {}, {
|
||||
class: [attr.class, this.config.classNames.hidden].filter(Boolean).join(' ')
|
||||
});
|
||||
|
||||
@ -2786,7 +2791,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
showMenuPanel = controls.showMenuPanel;
|
||||
this.elements.controls = null; // Larger overlaid play button
|
||||
|
||||
if (this.config.controls.includes('play-large')) {
|
||||
if (is$1.array(this.config.controls) && this.config.controls.includes('play-large')) {
|
||||
this.elements.container.appendChild(createButton.call(this, 'play-large'));
|
||||
} // Create the container
|
||||
|
||||
@ -2798,7 +2803,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
class: 'plyr__controls__item'
|
||||
}; // Loop through controls in order
|
||||
|
||||
dedupe(this.config.controls).forEach(function (control) {
|
||||
dedupe(is$1.array(this.config.controls) ? this.config.controls : []).forEach(function (control) {
|
||||
// Restart button
|
||||
if (control === 'restart') {
|
||||
container.appendChild(createButton.call(_this10, 'restart', defaultAttributes));
|
||||
@ -3117,8 +3122,6 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
if (update) {
|
||||
if (is$1.string(this.config.controls)) {
|
||||
container = replace(container);
|
||||
} else if (is$1.element(container)) {
|
||||
container.innerHTML = replace(container.innerHTML);
|
||||
}
|
||||
} // Controls container
|
||||
|
||||
@ -4103,10 +4106,12 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
if (is$1.element(button)) {
|
||||
button.pressed = this.active;
|
||||
} // Trigger an event
|
||||
} // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up
|
||||
|
||||
|
||||
triggerEvent.call(this.player, this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
var target = this.target === this.player.media ? this.target : this.player.elements.container; // Trigger an event
|
||||
|
||||
triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
}
|
||||
}, {
|
||||
key: "toggleFallback",
|
||||
@ -4572,7 +4577,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
// Loop through values (as they are the keys when the object is spread 🤔)
|
||||
Object.values(_objectSpread2({}, this.media.style)) // We're only fussed about Plyr specific properties
|
||||
.filter(function (key) {
|
||||
return !is$1.empty(key) && key.startsWith('--plyr');
|
||||
return !is$1.empty(key) && is$1.string(key) && key.startsWith('--plyr');
|
||||
}).forEach(function (key) {
|
||||
// Set on the container
|
||||
_this5.elements.container.style.setProperty(key, _this5.media.style.getPropertyValue(key)); // Clean up from media element
|
||||
@ -8293,9 +8298,9 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
|
||||
if (this.isHTML5 && this.config.autoplay) {
|
||||
setTimeout(function () {
|
||||
this.once('canplay', function () {
|
||||
return silencePromise(_this.play());
|
||||
}, 10);
|
||||
});
|
||||
} // Seek time will be recorded (in listeners.js) so we can prevent hiding controls for a few seconds after seek
|
||||
|
||||
|
||||
@ -8491,7 +8496,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
var hiding = toggleClass(this.elements.container, this.config.classNames.hideControls, force); // Close menu
|
||||
|
||||
if (hiding && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
if (hiding && is$1.array(this.config.controls) && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
controls.toggleMenu.call(this, false);
|
||||
} // Trigger event on change
|
||||
|
||||
@ -8584,7 +8589,9 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
} else {
|
||||
// Unbind listeners
|
||||
unbindListeners.call(_this3); // Replace the container with the original element provided
|
||||
unbindListeners.call(_this3); // Cancel current network requests
|
||||
|
||||
html5.cancelRequests.call(_this3); // Replace the container with the original element provided
|
||||
|
||||
replaceElement(_this3.elements.original, _this3.elements.container); // Event
|
||||
|
||||
|
||||
4
dist/plyr.min.js
vendored
4
dist/plyr.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.js.map
vendored
2
dist/plyr.min.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/plyr.min.mjs
vendored
4
dist/plyr.min.mjs
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.min.mjs.map
vendored
2
dist/plyr.min.mjs.map
vendored
File diff suppressed because one or more lines are too long
39
dist/plyr.mjs
vendored
39
dist/plyr.mjs
vendored
@ -1,4 +1,4 @@
|
||||
typeof navigator === "object" && function _classCallCheck(instance, Constructor) {
|
||||
function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
}
|
||||
@ -157,7 +157,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
||||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
@ -1078,7 +1078,7 @@ function triggerEvent(element) {
|
||||
|
||||
var event = new CustomEvent(type, {
|
||||
bubbles: bubbles,
|
||||
detail: _objectSpread2({}, detail, {
|
||||
detail: _objectSpread2(_objectSpread2({}, detail), {}, {
|
||||
plyr: this
|
||||
})
|
||||
}); // Dispatch the event
|
||||
@ -1191,7 +1191,12 @@ function setAspectRatio(input) {
|
||||
if (this.isVimeo && !this.config.vimeo.premium && this.supported.ui) {
|
||||
var height = 100 / this.media.offsetWidth * parseInt(window.getComputedStyle(this.media).paddingBottom, 10);
|
||||
var offset = (height - padding) / (height / 50);
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
|
||||
if (this.fullscreen.active) {
|
||||
wrapper.style.paddingBottom = null;
|
||||
} else {
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
}
|
||||
} else if (this.isHTML5) {
|
||||
wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null);
|
||||
}
|
||||
@ -1780,7 +1785,7 @@ var controls = {
|
||||
var attr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var text = i18n.get(key, this.config);
|
||||
|
||||
var attributes = _objectSpread2({}, attr, {
|
||||
var attributes = _objectSpread2(_objectSpread2({}, attr), {}, {
|
||||
class: [attr.class, this.config.classNames.hidden].filter(Boolean).join(' ')
|
||||
});
|
||||
|
||||
@ -2780,7 +2785,7 @@ var controls = {
|
||||
showMenuPanel = controls.showMenuPanel;
|
||||
this.elements.controls = null; // Larger overlaid play button
|
||||
|
||||
if (this.config.controls.includes('play-large')) {
|
||||
if (is$1.array(this.config.controls) && this.config.controls.includes('play-large')) {
|
||||
this.elements.container.appendChild(createButton.call(this, 'play-large'));
|
||||
} // Create the container
|
||||
|
||||
@ -2792,7 +2797,7 @@ var controls = {
|
||||
class: 'plyr__controls__item'
|
||||
}; // Loop through controls in order
|
||||
|
||||
dedupe(this.config.controls).forEach(function (control) {
|
||||
dedupe(is$1.array(this.config.controls) ? this.config.controls : []).forEach(function (control) {
|
||||
// Restart button
|
||||
if (control === 'restart') {
|
||||
container.appendChild(createButton.call(_this10, 'restart', defaultAttributes));
|
||||
@ -3111,8 +3116,6 @@ var controls = {
|
||||
if (update) {
|
||||
if (is$1.string(this.config.controls)) {
|
||||
container = replace(container);
|
||||
} else if (is$1.element(container)) {
|
||||
container.innerHTML = replace(container.innerHTML);
|
||||
}
|
||||
} // Controls container
|
||||
|
||||
@ -4097,10 +4100,12 @@ var Fullscreen = /*#__PURE__*/function () {
|
||||
|
||||
if (is$1.element(button)) {
|
||||
button.pressed = this.active;
|
||||
} // Trigger an event
|
||||
} // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up
|
||||
|
||||
|
||||
triggerEvent.call(this.player, this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
var target = this.target === this.player.media ? this.target : this.player.elements.container; // Trigger an event
|
||||
|
||||
triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
}
|
||||
}, {
|
||||
key: "toggleFallback",
|
||||
@ -4566,7 +4571,7 @@ var ui = {
|
||||
// Loop through values (as they are the keys when the object is spread 🤔)
|
||||
Object.values(_objectSpread2({}, this.media.style)) // We're only fussed about Plyr specific properties
|
||||
.filter(function (key) {
|
||||
return !is$1.empty(key) && key.startsWith('--plyr');
|
||||
return !is$1.empty(key) && is$1.string(key) && key.startsWith('--plyr');
|
||||
}).forEach(function (key) {
|
||||
// Set on the container
|
||||
_this5.elements.container.style.setProperty(key, _this5.media.style.getPropertyValue(key)); // Clean up from media element
|
||||
@ -8287,9 +8292,9 @@ var Plyr = /*#__PURE__*/function () {
|
||||
|
||||
|
||||
if (this.isHTML5 && this.config.autoplay) {
|
||||
setTimeout(function () {
|
||||
this.once('canplay', function () {
|
||||
return silencePromise(_this.play());
|
||||
}, 10);
|
||||
});
|
||||
} // Seek time will be recorded (in listeners.js) so we can prevent hiding controls for a few seconds after seek
|
||||
|
||||
|
||||
@ -8485,7 +8490,7 @@ var Plyr = /*#__PURE__*/function () {
|
||||
|
||||
var hiding = toggleClass(this.elements.container, this.config.classNames.hideControls, force); // Close menu
|
||||
|
||||
if (hiding && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
if (hiding && is$1.array(this.config.controls) && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
controls.toggleMenu.call(this, false);
|
||||
} // Trigger event on change
|
||||
|
||||
@ -8578,7 +8583,9 @@ var Plyr = /*#__PURE__*/function () {
|
||||
}
|
||||
} else {
|
||||
// Unbind listeners
|
||||
unbindListeners.call(_this3); // Replace the container with the original element provided
|
||||
unbindListeners.call(_this3); // Cancel current network requests
|
||||
|
||||
html5.cancelRequests.call(_this3); // Replace the container with the original element provided
|
||||
|
||||
replaceElement(_this3.elements.original, _this3.elements.container); // Event
|
||||
|
||||
|
||||
47
dist/plyr.polyfilled.js
vendored
47
dist/plyr.polyfilled.js
vendored
@ -1,7 +1,7 @@
|
||||
typeof navigator === "object" && (function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define('Plyr', factory) :
|
||||
(global = global || self, global.Plyr = factory());
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Plyr = factory());
|
||||
}(this, (function () { 'use strict';
|
||||
|
||||
// Polyfill for creating CustomEvents on IE9/10/11
|
||||
@ -4211,7 +4211,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
@ -4408,7 +4408,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
var checkIfURLSearchParamsSupported = function checkIfURLSearchParamsSupported() {
|
||||
try {
|
||||
var URLSearchParams = global.URLSearchParams;
|
||||
return new URLSearchParams('?a=1').toString() === 'a=1' && typeof URLSearchParams.prototype.set === 'function';
|
||||
return new URLSearchParams('?a=1').toString() === 'a=1' && typeof URLSearchParams.prototype.set === 'function' && typeof URLSearchParams.prototype.entries === 'function';
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
@ -4532,7 +4532,11 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
anchorElement.href = anchorElement.href; // force href to refresh
|
||||
}
|
||||
|
||||
if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href)) {
|
||||
var inputElement = doc.createElement('input');
|
||||
inputElement.type = 'url';
|
||||
inputElement.value = url;
|
||||
|
||||
if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href) || !inputElement.checkValidity() && !base) {
|
||||
throw new TypeError('Invalid URL');
|
||||
}
|
||||
|
||||
@ -7320,7 +7324,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
var event = new CustomEvent(type, {
|
||||
bubbles: bubbles,
|
||||
detail: _objectSpread2({}, detail, {
|
||||
detail: _objectSpread2(_objectSpread2({}, detail), {}, {
|
||||
plyr: this
|
||||
})
|
||||
}); // Dispatch the event
|
||||
@ -7433,7 +7437,12 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
if (this.isVimeo && !this.config.vimeo.premium && this.supported.ui) {
|
||||
var height = 100 / this.media.offsetWidth * parseInt(window.getComputedStyle(this.media).paddingBottom, 10);
|
||||
var offset = (height - padding) / (height / 50);
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
|
||||
if (this.fullscreen.active) {
|
||||
wrapper.style.paddingBottom = null;
|
||||
} else {
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
}
|
||||
} else if (this.isHTML5) {
|
||||
wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null);
|
||||
}
|
||||
@ -8107,7 +8116,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
var attr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var text = i18n.get(key, this.config);
|
||||
|
||||
var attributes = _objectSpread2({}, attr, {
|
||||
var attributes = _objectSpread2(_objectSpread2({}, attr), {}, {
|
||||
class: [attr.class, this.config.classNames.hidden].filter(Boolean).join(' ')
|
||||
});
|
||||
|
||||
@ -9107,7 +9116,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
showMenuPanel = controls.showMenuPanel;
|
||||
this.elements.controls = null; // Larger overlaid play button
|
||||
|
||||
if (this.config.controls.includes('play-large')) {
|
||||
if (is$1.array(this.config.controls) && this.config.controls.includes('play-large')) {
|
||||
this.elements.container.appendChild(createButton.call(this, 'play-large'));
|
||||
} // Create the container
|
||||
|
||||
@ -9119,7 +9128,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
class: 'plyr__controls__item'
|
||||
}; // Loop through controls in order
|
||||
|
||||
dedupe(this.config.controls).forEach(function (control) {
|
||||
dedupe(is$1.array(this.config.controls) ? this.config.controls : []).forEach(function (control) {
|
||||
// Restart button
|
||||
if (control === 'restart') {
|
||||
container.appendChild(createButton.call(_this10, 'restart', defaultAttributes));
|
||||
@ -9438,8 +9447,6 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
if (update) {
|
||||
if (is$1.string(this.config.controls)) {
|
||||
container = replace(container);
|
||||
} else if (is$1.element(container)) {
|
||||
container.innerHTML = replace(container.innerHTML);
|
||||
}
|
||||
} // Controls container
|
||||
|
||||
@ -10424,10 +10431,12 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
if (is$1.element(button)) {
|
||||
button.pressed = this.active;
|
||||
} // Trigger an event
|
||||
} // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up
|
||||
|
||||
|
||||
triggerEvent.call(this.player, this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
var target = this.target === this.player.media ? this.target : this.player.elements.container; // Trigger an event
|
||||
|
||||
triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
}
|
||||
}, {
|
||||
key: "toggleFallback",
|
||||
@ -10906,7 +10915,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
// Loop through values (as they are the keys when the object is spread 🤔)
|
||||
Object.values(_objectSpread2({}, this.media.style)) // We're only fussed about Plyr specific properties
|
||||
.filter(function (key) {
|
||||
return !is$1.empty(key) && key.startsWith('--plyr');
|
||||
return !is$1.empty(key) && is$1.string(key) && key.startsWith('--plyr');
|
||||
}).forEach(function (key) {
|
||||
// Set on the container
|
||||
_this5.elements.container.style.setProperty(key, _this5.media.style.getPropertyValue(key)); // Clean up from media element
|
||||
@ -14728,9 +14737,9 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
|
||||
if (this.isHTML5 && this.config.autoplay) {
|
||||
setTimeout(function () {
|
||||
this.once('canplay', function () {
|
||||
return silencePromise(_this.play());
|
||||
}, 10);
|
||||
});
|
||||
} // Seek time will be recorded (in listeners.js) so we can prevent hiding controls for a few seconds after seek
|
||||
|
||||
|
||||
@ -14926,7 +14935,7 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
|
||||
var hiding = toggleClass(this.elements.container, this.config.classNames.hideControls, force); // Close menu
|
||||
|
||||
if (hiding && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
if (hiding && is$1.array(this.config.controls) && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
controls.toggleMenu.call(this, false);
|
||||
} // Trigger event on change
|
||||
|
||||
@ -15019,7 +15028,9 @@ typeof navigator === "object" && (function (global, factory) {
|
||||
}
|
||||
} else {
|
||||
// Unbind listeners
|
||||
unbindListeners.call(_this3); // Replace the container with the original element provided
|
||||
unbindListeners.call(_this3); // Cancel current network requests
|
||||
|
||||
html5.cancelRequests.call(_this3); // Replace the container with the original element provided
|
||||
|
||||
replaceElement(_this3.elements.original, _this3.elements.container); // Event
|
||||
|
||||
|
||||
4
dist/plyr.polyfilled.min.js
vendored
4
dist/plyr.polyfilled.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.js.map
vendored
2
dist/plyr.polyfilled.min.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/plyr.polyfilled.min.mjs
vendored
4
dist/plyr.polyfilled.min.mjs
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.polyfilled.min.mjs.map
vendored
2
dist/plyr.polyfilled.min.mjs.map
vendored
File diff suppressed because one or more lines are too long
47
dist/plyr.polyfilled.mjs
vendored
47
dist/plyr.polyfilled.mjs
vendored
@ -1,4 +1,4 @@
|
||||
typeof navigator === "object" && // Polyfill for creating CustomEvents on IE9/10/11
|
||||
// Polyfill for creating CustomEvents on IE9/10/11
|
||||
// code pulled from:
|
||||
// https://github.com/d4tocchini/customevent-polyfill
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill
|
||||
@ -4205,7 +4205,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
||||
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
||||
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||||
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||||
if (n === "Map" || n === "Set") return Array.from(n);
|
||||
if (n === "Map" || n === "Set") return Array.from(o);
|
||||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
||||
}
|
||||
|
||||
@ -4402,7 +4402,7 @@ function _nonIterableRest() {
|
||||
var checkIfURLSearchParamsSupported = function checkIfURLSearchParamsSupported() {
|
||||
try {
|
||||
var URLSearchParams = global.URLSearchParams;
|
||||
return new URLSearchParams('?a=1').toString() === 'a=1' && typeof URLSearchParams.prototype.set === 'function';
|
||||
return new URLSearchParams('?a=1').toString() === 'a=1' && typeof URLSearchParams.prototype.set === 'function' && typeof URLSearchParams.prototype.entries === 'function';
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
@ -4526,7 +4526,11 @@ function _nonIterableRest() {
|
||||
anchorElement.href = anchorElement.href; // force href to refresh
|
||||
}
|
||||
|
||||
if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href)) {
|
||||
var inputElement = doc.createElement('input');
|
||||
inputElement.type = 'url';
|
||||
inputElement.value = url;
|
||||
|
||||
if (anchorElement.protocol === ':' || !/:/.test(anchorElement.href) || !inputElement.checkValidity() && !base) {
|
||||
throw new TypeError('Invalid URL');
|
||||
}
|
||||
|
||||
@ -7314,7 +7318,7 @@ function triggerEvent(element) {
|
||||
|
||||
var event = new CustomEvent(type, {
|
||||
bubbles: bubbles,
|
||||
detail: _objectSpread2({}, detail, {
|
||||
detail: _objectSpread2(_objectSpread2({}, detail), {}, {
|
||||
plyr: this
|
||||
})
|
||||
}); // Dispatch the event
|
||||
@ -7427,7 +7431,12 @@ function setAspectRatio(input) {
|
||||
if (this.isVimeo && !this.config.vimeo.premium && this.supported.ui) {
|
||||
var height = 100 / this.media.offsetWidth * parseInt(window.getComputedStyle(this.media).paddingBottom, 10);
|
||||
var offset = (height - padding) / (height / 50);
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
|
||||
if (this.fullscreen.active) {
|
||||
wrapper.style.paddingBottom = null;
|
||||
} else {
|
||||
this.media.style.transform = "translateY(-".concat(offset, "%)");
|
||||
}
|
||||
} else if (this.isHTML5) {
|
||||
wrapper.classList.toggle(this.config.classNames.videoFixedRatio, ratio !== null);
|
||||
}
|
||||
@ -8101,7 +8110,7 @@ var controls = {
|
||||
var attr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var text = i18n.get(key, this.config);
|
||||
|
||||
var attributes = _objectSpread2({}, attr, {
|
||||
var attributes = _objectSpread2(_objectSpread2({}, attr), {}, {
|
||||
class: [attr.class, this.config.classNames.hidden].filter(Boolean).join(' ')
|
||||
});
|
||||
|
||||
@ -9101,7 +9110,7 @@ var controls = {
|
||||
showMenuPanel = controls.showMenuPanel;
|
||||
this.elements.controls = null; // Larger overlaid play button
|
||||
|
||||
if (this.config.controls.includes('play-large')) {
|
||||
if (is$1.array(this.config.controls) && this.config.controls.includes('play-large')) {
|
||||
this.elements.container.appendChild(createButton.call(this, 'play-large'));
|
||||
} // Create the container
|
||||
|
||||
@ -9113,7 +9122,7 @@ var controls = {
|
||||
class: 'plyr__controls__item'
|
||||
}; // Loop through controls in order
|
||||
|
||||
dedupe(this.config.controls).forEach(function (control) {
|
||||
dedupe(is$1.array(this.config.controls) ? this.config.controls : []).forEach(function (control) {
|
||||
// Restart button
|
||||
if (control === 'restart') {
|
||||
container.appendChild(createButton.call(_this10, 'restart', defaultAttributes));
|
||||
@ -9432,8 +9441,6 @@ var controls = {
|
||||
if (update) {
|
||||
if (is$1.string(this.config.controls)) {
|
||||
container = replace(container);
|
||||
} else if (is$1.element(container)) {
|
||||
container.innerHTML = replace(container.innerHTML);
|
||||
}
|
||||
} // Controls container
|
||||
|
||||
@ -10418,10 +10425,12 @@ var Fullscreen = /*#__PURE__*/function () {
|
||||
|
||||
if (is$1.element(button)) {
|
||||
button.pressed = this.active;
|
||||
} // Trigger an event
|
||||
} // Always trigger events on the plyr / media element (not a fullscreen container) and let them bubble up
|
||||
|
||||
|
||||
triggerEvent.call(this.player, this.target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
var target = this.target === this.player.media ? this.target : this.player.elements.container; // Trigger an event
|
||||
|
||||
triggerEvent.call(this.player, target, this.active ? 'enterfullscreen' : 'exitfullscreen', true);
|
||||
}
|
||||
}, {
|
||||
key: "toggleFallback",
|
||||
@ -10900,7 +10909,7 @@ var ui = {
|
||||
// Loop through values (as they are the keys when the object is spread 🤔)
|
||||
Object.values(_objectSpread2({}, this.media.style)) // We're only fussed about Plyr specific properties
|
||||
.filter(function (key) {
|
||||
return !is$1.empty(key) && key.startsWith('--plyr');
|
||||
return !is$1.empty(key) && is$1.string(key) && key.startsWith('--plyr');
|
||||
}).forEach(function (key) {
|
||||
// Set on the container
|
||||
_this5.elements.container.style.setProperty(key, _this5.media.style.getPropertyValue(key)); // Clean up from media element
|
||||
@ -14722,9 +14731,9 @@ var Plyr = /*#__PURE__*/function () {
|
||||
|
||||
|
||||
if (this.isHTML5 && this.config.autoplay) {
|
||||
setTimeout(function () {
|
||||
this.once('canplay', function () {
|
||||
return silencePromise(_this.play());
|
||||
}, 10);
|
||||
});
|
||||
} // Seek time will be recorded (in listeners.js) so we can prevent hiding controls for a few seconds after seek
|
||||
|
||||
|
||||
@ -14920,7 +14929,7 @@ var Plyr = /*#__PURE__*/function () {
|
||||
|
||||
var hiding = toggleClass(this.elements.container, this.config.classNames.hideControls, force); // Close menu
|
||||
|
||||
if (hiding && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
if (hiding && is$1.array(this.config.controls) && this.config.controls.includes('settings') && !is$1.empty(this.config.settings)) {
|
||||
controls.toggleMenu.call(this, false);
|
||||
} // Trigger event on change
|
||||
|
||||
@ -15013,7 +15022,9 @@ var Plyr = /*#__PURE__*/function () {
|
||||
}
|
||||
} else {
|
||||
// Unbind listeners
|
||||
unbindListeners.call(_this3); // Replace the container with the original element provided
|
||||
unbindListeners.call(_this3); // Cancel current network requests
|
||||
|
||||
html5.cancelRequests.call(_this3); // Replace the container with the original element provided
|
||||
|
||||
replaceElement(_this3.elements.original, _this3.elements.container); // Event
|
||||
|
||||
|
||||
Reference in New Issue
Block a user