diff options
author | Sam Potts <sam@potts.es> | 2019-03-16 11:57:15 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-03-16 11:57:15 +1100 |
commit | 5b7a025d26d45ed1cfe39a4774c0f81667064bb1 (patch) | |
tree | 80c729a1fee228be7d10d19f89fb7f77d4bea569 /demo/dist/demo.js | |
parent | 4c3bf25b8a6228b8b48a28f351df1ae2523e6d19 (diff) | |
download | plyr-5b7a025d26d45ed1cfe39a4774c0f81667064bb1.tar.lz plyr-5b7a025d26d45ed1cfe39a4774c0f81667064bb1.tar.xz plyr-5b7a025d26d45ed1cfe39a4774c0f81667064bb1.zip |
Housekeeping
Diffstat (limited to 'demo/dist/demo.js')
-rw-r--r-- | demo/dist/demo.js | 89 |
1 files changed, 55 insertions, 34 deletions
diff --git a/demo/dist/demo.js b/demo/dist/demo.js index e87aca7d..4b8071b0 100644 --- a/demo/dist/demo.js +++ b/demo/dist/demo.js @@ -5883,7 +5883,7 @@ typeof navigator === "object" && (function () { 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; @@ -6003,8 +6003,8 @@ typeof navigator === "object" && (function () { 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); @@ -8236,13 +8236,13 @@ typeof navigator === "object" && (function () { }, // 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)); } } }; @@ -8548,11 +8548,11 @@ typeof navigator === "object" && (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 @@ -8807,7 +8807,7 @@ typeof navigator === "object" && (function () { }, { key: "controls", - value: function controls$$1() { + value: function controls$1() { var _this3 = this; var player = this.player; @@ -9170,16 +9170,23 @@ typeof navigator === "object" && (function () { 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'); @@ -9192,10 +9199,10 @@ typeof navigator === "object" && (function () { } 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) { @@ -9213,6 +9220,9 @@ typeof navigator === "object" && (function () { 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 @@ -9278,15 +9288,26 @@ typeof navigator === "object" && (function () { } 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. @@ -9392,7 +9413,7 @@ typeof navigator === "object" && (function () { } }, // API Ready - ready: function ready$$1() { + ready: function ready() { var _this2 = this; var player = this; @@ -9771,7 +9792,7 @@ typeof navigator === "object" && (function () { } }, // API ready - ready: function ready$$1() { + ready: function ready() { var player = this; // Ignore already setup (race condition) var currentId = player.media.getAttribute('id'); @@ -9799,8 +9820,8 @@ typeof navigator === "object" && (function () { }); 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) @@ -10193,7 +10214,7 @@ typeof navigator === "object" && (function () { }, { key: "ready", - value: function ready$$1() { + value: function ready() { var _this3 = this; // Start ticking our safety timer. If the whole advertisement @@ -10677,7 +10698,7 @@ typeof navigator === "object" && (function () { }, { key: "on", - value: function on$$1(event, callback) { + value: function on(event, callback) { if (!is$1.array(this.events[event])) { this.events[event] = []; } @@ -12025,7 +12046,7 @@ typeof navigator === "object" && (function () { }, { key: "on", - value: function on$$1(event, callback) { + value: function on$1(event, callback) { on.call(this, this.elements.container, event, callback); } /** @@ -12036,7 +12057,7 @@ typeof navigator === "object" && (function () { }, { key: "once", - value: function once$$1(event, callback) { + value: function once$1(event, callback) { once.call(this, this.elements.container, event, callback); } /** @@ -12047,7 +12068,7 @@ typeof navigator === "object" && (function () { }, { key: "off", - value: function off$$1(event, callback) { + value: function off$1(event, callback) { off(this.elements.container, event, callback); } /** @@ -12706,7 +12727,7 @@ typeof navigator === "object" && (function () { }, { key: "loadSprite", - value: function loadSprite$$1(url, id) { + value: function loadSprite$1(url, id) { return loadSprite(url, id); } /** |