diff options
Diffstat (limited to 'dist/plyr.polyfilled.mjs')
-rw-r--r-- | dist/plyr.polyfilled.mjs | 103 |
1 files changed, 62 insertions, 41 deletions
diff --git a/dist/plyr.polyfilled.mjs b/dist/plyr.polyfilled.mjs index ac5c574b..c005d62a 100644 --- a/dist/plyr.polyfilled.mjs +++ b/dist/plyr.polyfilled.mjs @@ -1757,7 +1757,7 @@ _setToStringTag(_global.JSON, 'JSON', true); }; var deserializeParam = function deserializeParam(value) { - return decodeURIComponent(value).replace(/\+/g, ' '); + return decodeURIComponent(String(value).replace(/\+/g, ' ')); }; var polyfillURLSearchParams = function polyfillURLSearchParams() { @@ -1885,11 +1885,11 @@ _setToStringTag(_global.JSON, 'JSON', true); global.URLSearchParams = URLSearchParams; }; - if (!('URLSearchParams' in global) || new URLSearchParams('?a=1').toString() !== 'a=1') { + if (!('URLSearchParams' in global) || new global.URLSearchParams('?a=1').toString() !== 'a=1') { polyfillURLSearchParams(); } - var proto = URLSearchParams.prototype; + var proto = global.URLSearchParams.prototype; if (typeof proto.sort !== 'function') { proto.sort = function () { @@ -1965,7 +1965,7 @@ _setToStringTag(_global.JSON, 'JSON', true); */ var checkIfURLIsSupported = function checkIfURLIsSupported() { try { - var u = new URL('b', 'http://a'); + var u = new global.URL('b', 'http://a'); u.pathname = 'c%20d'; return u.href === 'http://a/c%20d' && u.searchParams; } catch (e) { @@ -2011,7 +2011,7 @@ _setToStringTag(_global.JSON, 'JSON', true); value: anchorElement }); // create a linked searchParams which reflect its changes on URL - var searchParams = new URLSearchParams(this.search); + var searchParams = new global.URLSearchParams(this.search); var enableSearchUpdate = true; var enableSearchParamsUpdate = true; @@ -2636,7 +2636,7 @@ var getWeak = _meta.getWeak; var arrayFind = _arrayMethods(5); var arrayFindIndex = _arrayMethods(6); -var id$2 = 0; +var id$1 = 0; // fallback for uncaught frozen keys var uncaughtFrozenStore = function (that) { @@ -2677,7 +2677,7 @@ var _collectionWeak = { var C = wrapper(function (that, iterable) { _anInstance(that, C, NAME, '_i'); that._t = NAME; // collection type - that._i = id$2++; // collection id + that._i = id$1++; // collection id that._l = undefined; // leak store for uncaught frozen objects if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that); }); @@ -5415,7 +5415,7 @@ var controls = { list.appendChild(menuItem); }, // Format a time for display - formatTime: function formatTime$$1() { + formatTime: function formatTime$1() { var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var inverted = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; @@ -5535,8 +5535,8 @@ var controls = { range.setAttribute('aria-valuenow', this.currentTime); var currentTime = controls.formatTime(this.currentTime); var duration = controls.formatTime(this.duration); - var format$$1 = i18n.get('seekLabel', this.config); - range.setAttribute('aria-valuetext', format$$1.replace('{currentTime}', currentTime).replace('{duration}', duration)); + var format = i18n.get('seekLabel', this.config); + range.setAttribute('aria-valuetext', format.replace('{currentTime}', currentTime).replace('{duration}', duration)); } else if (matches$1(range, this.config.selectors.inputs.volume)) { var percent = range.value * 100; range.setAttribute('aria-valuenow', percent); @@ -7778,13 +7778,13 @@ var ui = { }, // Toggle controls based on state and `force` argument toggleControls: function toggleControls(force) { - var controls$$1 = this.elements.controls; + var controls = this.elements.controls; - if (controls$$1 && this.config.hideControls) { + if (controls && this.config.hideControls) { // Don't hide controls if a touch-device user recently seeked. (Must be limited to touch devices, or it occasionally prevents desktop controls from hiding.) var recentTouchSeek = this.touch && this.lastSeekTime + 2000 > Date.now(); // Show controls if force, loading, paused, button interaction, or recent seek, otherwise hide - this.toggleControls(Boolean(force || this.loading || this.paused || controls$$1.pressed || controls$$1.hover || recentTouchSeek)); + this.toggleControls(Boolean(force || this.loading || this.paused || controls.pressed || controls.hover || recentTouchSeek)); } } }; @@ -8090,11 +8090,11 @@ function () { on.call(player, elements.container, 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen', function (event) { - var controls$$1 = elements.controls; // Remove button states for fullscreen + var controls = elements.controls; // Remove button states for fullscreen - if (controls$$1 && event.type === 'enterfullscreen') { - controls$$1.pressed = false; - controls$$1.hover = false; + if (controls && event.type === 'enterfullscreen') { + controls.pressed = false; + controls.hover = false; } // Show, then hide after a timeout unless another control event occurs @@ -8349,7 +8349,7 @@ function () { }, { key: "controls", - value: function controls$$1() { + value: function controls$1() { var _this3 = this; var player = this.player; @@ -8712,16 +8712,23 @@ var loadjs_umd = createCommonjsModule(function (module, exports) { maxTries = (args.numRetries || 0) + 1, beforeCallbackFn = args.before || devnull, pathStripped = path.replace(/^(css|img)!/, ''), - isCss, + isLegacyIECss, e; numTries = numTries || 0; if (/(^css!|\.css$)/.test(path)) { - isCss = true; // css - + // css e = doc.createElement('link'); e.rel = 'stylesheet'; - e.href = pathStripped; //.replace(/^css!/, ''); // remove "css!" prefix + e.href = pathStripped; // tag IE9+ + + isLegacyIECss = 'hideFocus' in e; // use preload in IE Edge (to detect load errors) + + if (isLegacyIECss && e.relList) { + isLegacyIECss = 0; + e.rel = 'preload'; + e.as = 'style'; + } } else if (/(^img!|\.(png|gif|jpg|svg)$)/.test(path)) { // image e = doc.createElement('img'); @@ -8734,10 +8741,10 @@ var loadjs_umd = createCommonjsModule(function (module, exports) { } e.onload = e.onerror = e.onbeforeload = function (ev) { - var result = ev.type[0]; // Note: The following code isolates IE using `hideFocus` and treats empty - // stylesheets as failures to get around lack of onerror support + var result = ev.type[0]; // treat empty stylesheets as failures to get around lack of onerror + // support in IE9-11 - if (isCss && 'hideFocus' in e) { + if (isLegacyIECss) { try { if (!e.sheet.cssText.length) result = 'e'; } catch (x) { @@ -8755,6 +8762,9 @@ var loadjs_umd = createCommonjsModule(function (module, exports) { if (numTries < maxTries) { return loadFile(path, callbackFn, args, numTries); } + } else if (e.rel == 'preload' && e.as == 'style') { + // activate preloaded stylesheets + return e.rel = 'stylesheet'; // jshint ignore:line } // execute callback @@ -8820,15 +8830,26 @@ var loadjs_umd = createCommonjsModule(function (module, exports) { } else { bundleIdCache[bundleId] = true; } - } // load scripts + } + function loadFn(resolve, reject) { + loadFiles(paths, function (pathsNotFound) { + // execute callbacks + executeCallbacks(args, pathsNotFound); // resolve Promise - loadFiles(paths, function (pathsNotFound) { - // execute callbacks - executeCallbacks(args, pathsNotFound); // publish bundle load event + if (resolve) { + executeCallbacks({ + success: resolve, + error: reject + }, pathsNotFound); + } // publish bundle load event + + + publish(bundleId, pathsNotFound); + }, args); + } - publish(bundleId, pathsNotFound); - }, args); + if (args.returnPromise) return new Promise(loadFn);else loadFn(); } /** * Execute callbacks when dependencies have been satisfied. @@ -8933,7 +8954,7 @@ var vimeo = { } }, // API Ready - ready: function ready$$1() { + ready: function ready() { var _this2 = this; var player = this; @@ -9310,7 +9331,7 @@ var youtube = { } }, // API ready - ready: function ready$$1() { + ready: function ready() { var player = this; // Ignore already setup (race condition) var currentId = player.media.getAttribute('id'); @@ -9338,8 +9359,8 @@ var youtube = { }); player.media = replaceElement(container, player.media); // Id to poster wrapper - var posterSrc = function posterSrc(format$$1) { - return "https://img.youtube.com/vi/".concat(videoId, "/").concat(format$$1, "default.jpg"); + var posterSrc = function posterSrc(format) { + return "https://img.youtube.com/vi/".concat(videoId, "/").concat(format, "default.jpg"); }; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide) @@ -9731,7 +9752,7 @@ function () { }, { key: "ready", - value: function ready$$1() { + value: function ready() { var _this3 = this; // Start ticking our safety timer. If the whole advertisement @@ -10215,7 +10236,7 @@ function () { }, { key: "on", - value: function on$$1(event, callback) { + value: function on(event, callback) { if (!is$2.array(this.events[event])) { this.events[event] = []; } @@ -11577,7 +11598,7 @@ function () { }, { key: "on", - value: function on$$1(event, callback) { + value: function on$1(event, callback) { on.call(this, this.elements.container, event, callback); } /** @@ -11588,7 +11609,7 @@ function () { }, { key: "once", - value: function once$$1(event, callback) { + value: function once$1(event, callback) { once.call(this, this.elements.container, event, callback); } /** @@ -11599,7 +11620,7 @@ function () { }, { key: "off", - value: function off$$1(event, callback) { + value: function off$1(event, callback) { off(this.elements.container, event, callback); } /** @@ -12258,7 +12279,7 @@ function () { }, { key: "loadSprite", - value: function loadSprite$$1(url, id) { + value: function loadSprite$1(url, id) { return loadSprite(url, id); } /** |