aboutsummaryrefslogtreecommitdiffstats
path: root/demo/dist/demo.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2019-06-01 19:50:29 +1000
committerSam Potts <sam@potts.es>2019-06-01 19:50:29 +1000
commit0249772f019762ebd494ac409e597103820413c3 (patch)
tree9831cbec7cf13676dba464cc01679fab2172f103 /demo/dist/demo.js
parent5d699d5f47e5bce9e6c59ff5a1f3fab236d7e00f (diff)
downloadplyr-0249772f019762ebd494ac409e597103820413c3.tar.lz
plyr-0249772f019762ebd494ac409e597103820413c3.tar.xz
plyr-0249772f019762ebd494ac409e597103820413c3.zip
Clean up
Diffstat (limited to 'demo/dist/demo.js')
-rw-r--r--demo/dist/demo.js38
1 files changed, 17 insertions, 21 deletions
diff --git a/demo/dist/demo.js b/demo/dist/demo.js
index d0f3035f..082cc701 100644
--- a/demo/dist/demo.js
+++ b/demo/dist/demo.js
@@ -8703,8 +8703,8 @@ typeof navigator === "object" && (function () {
};
var resized = function resized() {
- window.clearTimeout(timers.resized);
- timers.resized = window.setTimeout(setPlayerSize, 50);
+ clearTimeout(timers.resized);
+ timers.resized = setTimeout(setPlayerSize, 50);
};
on.call(player, elements.container, 'enterfullscreen exitfullscreen', function (event) {
@@ -9841,23 +9841,22 @@ typeof navigator === "object" && (function () {
if (is$1.object(window.YT) && is$1.function(window.YT.Player)) {
youtube.ready.call(this);
} else {
- // Load the API
- loadScript(this.config.urls.youtube.sdk).catch(function (error) {
- _this.debug.warn('YouTube API failed to load', error);
- }); // Setup callback for the API
- // YouTube has it's own system of course...
+ // Reference current global callback
+ var callback = window.onYouTubeIframeAPIReady; // Set callback to process queue
- window.onYouTubeReadyCallbacks = window.onYouTubeReadyCallbacks || []; // Add to queue
+ window.onYouTubeIframeAPIReady = function () {
+ // Call global callback if set
+ if (is$1.function(callback)) {
+ callback();
+ }
- window.onYouTubeReadyCallbacks.push(function () {
youtube.ready.call(_this);
- }); // Set callback to process queue
+ }; // Load the SDK
- window.onYouTubeIframeAPIReady = function () {
- window.onYouTubeReadyCallbacks.forEach(function (callback) {
- callback();
- });
- };
+
+ loadScript(this.config.urls.youtube.sdk).catch(function (error) {
+ _this.debug.warn('YouTube API failed to load', error);
+ });
}
},
// Get the media title
@@ -9887,7 +9886,7 @@ typeof navigator === "object" && (function () {
ready: function ready() {
var player = this; // Ignore already setup (race condition)
- var currentId = player.media.getAttribute('id');
+ var currentId = player.media && player.media.getAttribute('id');
if (!is$1.empty(currentId) && currentId.startsWith('youtube-')) {
return;
@@ -11309,11 +11308,8 @@ typeof navigator === "object" && (function () {
if (image.dataset.index !== currentImage.dataset.index && !image.dataset.deleting) {
// Wait 200ms, as the new image can take some time to show on certain browsers (even though it was downloaded before showing). This will prevent flicker, and show some generosity towards slower clients
// First set attribute 'deleting' to prevent multi-handling of this on repeat firing of this function
- extend(image, {
- dataset: {
- deleting: true
- }
- }); // This has to be set before the timeout - to prevent issues switching between hover and scrub
+ // eslint-disable-next-line no-param-reassign
+ image.dataset.deleting = true; // This has to be set before the timeout - to prevent issues switching between hover and scrub
var currentImageContainer = _this8.currentImageContainer;
setTimeout(function () {