pkg: deploy v3.6.3
This commit is contained in:
parent
e8d883edba
commit
b444aa3a98
@ -134,13 +134,13 @@ See [initialising](#initialising) for more information on advanced setups.
|
|||||||
You can use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript. There's 2 versions; one with and one without [polyfills](#polyfills). My recommendation would be to manage polyfills seperately as part of your application but to make life easier you can use the polyfilled build.
|
You can use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript. There's 2 versions; one with and one without [polyfills](#polyfills). My recommendation would be to manage polyfills seperately as part of your application but to make life easier you can use the polyfilled build.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/3.6.2/plyr.js"></script>
|
<script src="https://cdn.plyr.io/3.6.3/plyr.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
...or...
|
...or...
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/3.6.2/plyr.polyfilled.js"></script>
|
<script src="https://cdn.plyr.io/3.6.3/plyr.polyfilled.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
## CSS
|
## CSS
|
||||||
@ -154,13 +154,13 @@ Include the `plyr.css` stylsheet into your `<head>`.
|
|||||||
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:
|
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdn.plyr.io/3.6.2/plyr.css" />
|
<link rel="stylesheet" href="https://cdn.plyr.io/3.6.3/plyr.css" />
|
||||||
```
|
```
|
||||||
|
|
||||||
## SVG Sprite
|
## SVG Sprite
|
||||||
|
|
||||||
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For
|
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For
|
||||||
reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.2/plyr.svg`.
|
reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.3/plyr.svg`.
|
||||||
|
|
||||||
# Ads
|
# Ads
|
||||||
|
|
||||||
|
2
demo/dist/demo.css
vendored
2
demo/dist/demo.css
vendored
File diff suppressed because one or more lines are too long
2377
demo/dist/demo.js
vendored
2377
demo/dist/demo.js
vendored
File diff suppressed because it is too large
Load Diff
6
demo/dist/demo.min.js
vendored
6
demo/dist/demo.min.js
vendored
File diff suppressed because one or more lines are too long
2
demo/dist/demo.min.js.map
vendored
2
demo/dist/demo.min.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.css
vendored
2
dist/plyr.css
vendored
File diff suppressed because one or more lines are too long
164
dist/plyr.js
vendored
164
dist/plyr.js
vendored
@ -3659,7 +3659,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
// Sprite (for icons)
|
// Sprite (for icons)
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/3.6.2/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/3.6.3/plyr.svg',
|
||||||
// Blank video (used to prevent errors on source change)
|
// Blank video (used to prevent errors on source change)
|
||||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||||
// Quality default
|
// Quality default
|
||||||
@ -3777,7 +3777,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
vimeo: {
|
vimeo: {
|
||||||
sdk: 'https://player.vimeo.com/api/player.js',
|
sdk: 'https://player.vimeo.com/api/player.js',
|
||||||
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
||||||
api: 'https://vimeo.com/api/v2/video/{0}.json'
|
api: 'https://vimeo.com/api/oembed.json?url={0}'
|
||||||
},
|
},
|
||||||
youtube: {
|
youtube: {
|
||||||
sdk: 'https://www.youtube.com/iframe_api',
|
sdk: 'https://www.youtube.com/iframe_api',
|
||||||
@ -3947,24 +3947,27 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
title: false,
|
title: false,
|
||||||
speed: true,
|
speed: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
referrerPolicy: null,
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
||||||
// Whether the owner of the video has a Pro or Business account
|
// Whether the owner of the video has a Pro or Business account
|
||||||
// (which allows us to properly hide controls without CSS hacks, etc)
|
// (which allows us to properly hide controls without CSS hacks, etc)
|
||||||
premium: false,
|
premium: false
|
||||||
// Custom settings from Plyr
|
|
||||||
referrerPolicy: null // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// YouTube plugin
|
// YouTube plugin
|
||||||
youtube: {
|
youtube: {
|
||||||
noCookie: true,
|
|
||||||
// Whether to use an alternative version of YouTube without cookies
|
|
||||||
rel: 0,
|
rel: 0,
|
||||||
// No related vids
|
// No related vids
|
||||||
showinfo: 0,
|
showinfo: 0,
|
||||||
// Hide info
|
// Hide info
|
||||||
iv_load_policy: 3,
|
iv_load_policy: 3,
|
||||||
// Hide annotations
|
// Hide annotations
|
||||||
modestbranding: 1 // Hide logos as much as possible (they still show one in the corner when paused)
|
modestbranding: 1,
|
||||||
|
// Hide logos as much as possible (they still show one in the corner when paused)
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
noCookie: false // Whether to use an alternative version of YouTube without cookies
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -4083,7 +4086,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_this.toggle();
|
_this.player.listeners.proxy(event, _this.toggle, 'fullscreen');
|
||||||
}); // Tap focus when in fullscreen
|
}); // Tap focus when in fullscreen
|
||||||
|
|
||||||
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
||||||
@ -4493,7 +4496,9 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
} // Set property synchronously to respect the call order
|
} // Set property synchronously to respect the call order
|
||||||
|
|
||||||
|
|
||||||
this.media.setAttribute('data-poster', poster); // Wait until ui is ready
|
this.media.setAttribute('data-poster', poster); // Show the poster
|
||||||
|
|
||||||
|
this.elements.poster.removeAttribute('hidden'); // Wait until ui is ready
|
||||||
|
|
||||||
return ready.call(this) // Load image
|
return ready.call(this) // Load image
|
||||||
.then(function () {
|
.then(function () {
|
||||||
@ -4925,7 +4930,14 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
||||||
|
|
||||||
|
|
||||||
setGutter(ratio, padding, isEnter); // If not using native browser fullscreen API, we need to check for resizes of viewport
|
setGutter(ratio, padding, isEnter); // Horrible hack for Safari 14 not repainting properly on entering fullscreen
|
||||||
|
|
||||||
|
if (isEnter) {
|
||||||
|
setTimeout(function () {
|
||||||
|
return repaint(elements.container);
|
||||||
|
}, 100);
|
||||||
|
} // If not using native browser fullscreen API, we need to check for resizes of viewport
|
||||||
|
|
||||||
|
|
||||||
if (!usingNative) {
|
if (!usingNative) {
|
||||||
if (isEnter) {
|
if (isEnter) {
|
||||||
@ -5116,9 +5128,17 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.rewind, 'click', player.rewind, 'rewind'); // Rewind
|
this.bind(elements.buttons.rewind, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after rewind
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.rewind();
|
||||||
|
}, 'rewind'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.fastForward, 'click', player.forward, 'fastForward'); // Mute toggle
|
this.bind(elements.buttons.fastForward, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after fast forward
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.forward();
|
||||||
|
}, 'fastForward'); // Mute toggle
|
||||||
|
|
||||||
this.bind(elements.buttons.mute, 'click', function () {
|
this.bind(elements.buttons.mute, 'click', function () {
|
||||||
player.muted = !player.muted;
|
player.muted = !player.muted;
|
||||||
@ -5773,35 +5793,32 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
} // Inject the package
|
} // Inject the package
|
||||||
|
|
||||||
|
|
||||||
var poster = player.poster;
|
if (premium || !config.customControls) {
|
||||||
|
iframe.setAttribute('data-poster', player.poster);
|
||||||
if (premium) {
|
|
||||||
iframe.setAttribute('data-poster', poster);
|
|
||||||
player.media = replaceElement(iframe, player.media);
|
player.media = replaceElement(iframe, player.media);
|
||||||
} else {
|
} else {
|
||||||
var wrapper = createElement('div', {
|
var wrapper = createElement('div', {
|
||||||
class: player.config.classNames.embedContainer,
|
class: player.config.classNames.embedContainer,
|
||||||
'data-poster': poster
|
'data-poster': player.poster
|
||||||
});
|
});
|
||||||
wrapper.appendChild(iframe);
|
wrapper.appendChild(iframe);
|
||||||
player.media = replaceElement(wrapper, player.media);
|
player.media = replaceElement(wrapper, player.media);
|
||||||
} // Get poster image
|
} // Get poster image
|
||||||
|
|
||||||
|
|
||||||
fetch(format(player.config.urls.vimeo.api, id), 'json').then(function (response) {
|
if (!config.customControls) {
|
||||||
if (is$1.empty(response)) {
|
fetch(format(player.config.urls.vimeo.api, src)).then(function (response) {
|
||||||
return;
|
if (is$1.empty(response) || !response.thumbnail_url) {
|
||||||
} // Get the URL for thumbnail
|
return;
|
||||||
|
} // Set and show poster
|
||||||
|
|
||||||
|
|
||||||
var url = new URL(response[0].thumbnail_large); // Get original image
|
ui.setPoster.call(player, response.thumbnail_url).catch(function () {});
|
||||||
|
});
|
||||||
url.pathname = "".concat(url.pathname.split('_')[0], ".jpg"); // Set and show poster
|
} // Setup instance
|
||||||
|
|
||||||
ui.setPoster.call(player, url.href).catch(function () {});
|
|
||||||
}); // Setup instance
|
|
||||||
// https://github.com/vimeo/player.js
|
// https://github.com/vimeo/player.js
|
||||||
|
|
||||||
|
|
||||||
player.embed = new window.Vimeo.Player(iframe, {
|
player.embed = new window.Vimeo.Player(iframe, {
|
||||||
autopause: player.config.autopause,
|
autopause: player.config.autopause,
|
||||||
muted: player.muted
|
muted: player.muted
|
||||||
@ -6041,9 +6058,11 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
triggerEvent.call(player, player.media, 'error');
|
triggerEvent.call(player, player.media, 'error');
|
||||||
}); // Rebuild UI
|
}); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 0);
|
return ui.build.call(player);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6136,7 +6155,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
},
|
},
|
||||||
// API ready
|
// API ready
|
||||||
ready: function ready() {
|
ready: function ready() {
|
||||||
var player = this; // Ignore already setup (race condition)
|
var player = this;
|
||||||
|
var config = player.config.youtube; // Ignore already setup (race condition)
|
||||||
|
|
||||||
var currentId = player.media && player.media.getAttribute('id');
|
var currentId = player.media && player.media.getAttribute('id');
|
||||||
|
|
||||||
@ -6153,53 +6173,53 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
|
|
||||||
var videoId = parseId$1(source);
|
var videoId = parseId$1(source);
|
||||||
var id = generateId(player.provider); // Get poster, if already set
|
var id = generateId(player.provider); // Replace media element
|
||||||
|
|
||||||
var poster = player.poster; // Replace media element
|
|
||||||
|
|
||||||
var container = createElement('div', {
|
var container = createElement('div', {
|
||||||
id: id,
|
id: id,
|
||||||
'data-poster': poster
|
'data-poster': config.customControls ? player.poster : undefined
|
||||||
});
|
});
|
||||||
player.media = replaceElement(container, player.media); // Id to poster wrapper
|
player.media = replaceElement(container, player.media); // Only load the poster when using custom controls
|
||||||
|
|
||||||
var posterSrc = function posterSrc(s) {
|
if (config.customControls) {
|
||||||
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
var posterSrc = function posterSrc(s) {
|
||||||
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
||||||
|
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
||||||
|
|
||||||
|
|
||||||
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('sd'), 121);
|
return loadImage(posterSrc('sd'), 121);
|
||||||
}) // 480p padded 4:3
|
}) // 480p padded 4:3
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('hq'));
|
return loadImage(posterSrc('hq'));
|
||||||
}) // 360p padded 4:3. Always exists
|
}) // 360p padded 4:3. Always exists
|
||||||
.then(function (image) {
|
.then(function (image) {
|
||||||
return ui.setPoster.call(player, image.src);
|
return ui.setPoster.call(player, image.src);
|
||||||
}).then(function (src) {
|
}).then(function (src) {
|
||||||
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
||||||
if (!src.includes('maxres')) {
|
if (!src.includes('maxres')) {
|
||||||
player.elements.poster.style.backgroundSize = 'cover';
|
player.elements.poster.style.backgroundSize = 'cover';
|
||||||
}
|
}
|
||||||
}).catch(function () {});
|
}).catch(function () {});
|
||||||
var config = player.config.youtube; // Setup instance
|
} // Setup instance
|
||||||
// https://developers.google.com/youtube/iframe_api_reference
|
// https://developers.google.com/youtube/iframe_api_reference
|
||||||
|
|
||||||
player.embed = new window.YT.Player(id, {
|
|
||||||
|
player.embed = new window.YT.Player(player.media, {
|
||||||
videoId: videoId,
|
videoId: videoId,
|
||||||
host: getHost(config),
|
host: getHost(config),
|
||||||
playerVars: extend({}, {
|
playerVars: extend({}, {
|
||||||
autoplay: player.config.autoplay ? 1 : 0,
|
|
||||||
// Autoplay
|
// Autoplay
|
||||||
hl: player.config.hl,
|
autoplay: player.config.autoplay ? 1 : 0,
|
||||||
// iframe interface language
|
// iframe interface language
|
||||||
controls: player.supported.ui ? 0 : 1,
|
hl: player.config.hl,
|
||||||
// Only show controls if not fully supported
|
// Only show controls if not fully supported or opted out
|
||||||
disablekb: 1,
|
controls: player.supported.ui && config.customControls ? 0 : 1,
|
||||||
// Disable keyboard as we handle it
|
// Disable keyboard as we handle it
|
||||||
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
disablekb: 1,
|
||||||
// Allow iOS inline playback
|
// Allow iOS inline playback
|
||||||
|
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
||||||
// Captions are flaky on YouTube
|
// Captions are flaky on YouTube
|
||||||
cc_load_policy: player.captions.active ? 1 : 0,
|
cc_load_policy: player.captions.active ? 1 : 0,
|
||||||
cc_lang_pref: player.config.captions.language,
|
cc_lang_pref: player.config.captions.language,
|
||||||
@ -6310,6 +6330,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var toggle = is$1.boolean(input) ? input : muted;
|
var toggle = is$1.boolean(input) ? input : muted;
|
||||||
muted = toggle;
|
muted = toggle;
|
||||||
instance[toggle ? 'mute' : 'unMute']();
|
instance[toggle ? 'mute' : 'unMute']();
|
||||||
|
instance.setVolume(volume * 100);
|
||||||
triggerEvent.call(player, player.media, 'volumechange');
|
triggerEvent.call(player, player.media, 'volumechange');
|
||||||
}
|
}
|
||||||
}); // Source
|
}); // Source
|
||||||
@ -6332,7 +6353,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
return player.config.speed.options.includes(s);
|
return player.config.speed.options.includes(s);
|
||||||
}); // Set the tabindex to avoid focus entering iframe
|
}); // Set the tabindex to avoid focus entering iframe
|
||||||
|
|
||||||
if (player.supported.ui) {
|
if (player.supported.ui && config.customControls) {
|
||||||
player.media.setAttribute('tabindex', -1);
|
player.media.setAttribute('tabindex', -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6359,9 +6380,11 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
}
|
}
|
||||||
}, 200); // Rebuild UI
|
}, 200); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 50);
|
return ui.build.call(player);
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onStateChange: function onStateChange(event) {
|
onStateChange: function onStateChange(event) {
|
||||||
// Get the instance
|
// Get the instance
|
||||||
@ -6407,7 +6430,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
||||||
if (!player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
if (config.customControls && !player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
||||||
player.media.pause();
|
player.media.pause();
|
||||||
} else {
|
} else {
|
||||||
assurePlaybackState$1.call(player, true);
|
assurePlaybackState$1.call(player, true);
|
||||||
@ -6481,7 +6504,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
wrap(this.media, this.elements.wrapper); // Poster image container
|
wrap(this.media, this.elements.wrapper); // Poster image container
|
||||||
|
|
||||||
this.elements.poster = createElement('div', {
|
this.elements.poster = createElement('div', {
|
||||||
class: this.config.classNames.poster
|
class: this.config.classNames.poster,
|
||||||
|
hidden: ''
|
||||||
});
|
});
|
||||||
this.elements.wrapper.appendChild(this.elements.poster);
|
this.elements.wrapper.appendChild(this.elements.poster);
|
||||||
}
|
}
|
||||||
|
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
2
dist/plyr.min.mjs
vendored
2
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
164
dist/plyr.mjs
vendored
164
dist/plyr.mjs
vendored
@ -3653,7 +3653,7 @@ var defaults$1 = {
|
|||||||
// Sprite (for icons)
|
// Sprite (for icons)
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/3.6.2/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/3.6.3/plyr.svg',
|
||||||
// Blank video (used to prevent errors on source change)
|
// Blank video (used to prevent errors on source change)
|
||||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||||
// Quality default
|
// Quality default
|
||||||
@ -3771,7 +3771,7 @@ var defaults$1 = {
|
|||||||
vimeo: {
|
vimeo: {
|
||||||
sdk: 'https://player.vimeo.com/api/player.js',
|
sdk: 'https://player.vimeo.com/api/player.js',
|
||||||
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
||||||
api: 'https://vimeo.com/api/v2/video/{0}.json'
|
api: 'https://vimeo.com/api/oembed.json?url={0}'
|
||||||
},
|
},
|
||||||
youtube: {
|
youtube: {
|
||||||
sdk: 'https://www.youtube.com/iframe_api',
|
sdk: 'https://www.youtube.com/iframe_api',
|
||||||
@ -3941,24 +3941,27 @@ var defaults$1 = {
|
|||||||
title: false,
|
title: false,
|
||||||
speed: true,
|
speed: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
referrerPolicy: null,
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
||||||
// Whether the owner of the video has a Pro or Business account
|
// Whether the owner of the video has a Pro or Business account
|
||||||
// (which allows us to properly hide controls without CSS hacks, etc)
|
// (which allows us to properly hide controls without CSS hacks, etc)
|
||||||
premium: false,
|
premium: false
|
||||||
// Custom settings from Plyr
|
|
||||||
referrerPolicy: null // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// YouTube plugin
|
// YouTube plugin
|
||||||
youtube: {
|
youtube: {
|
||||||
noCookie: true,
|
|
||||||
// Whether to use an alternative version of YouTube without cookies
|
|
||||||
rel: 0,
|
rel: 0,
|
||||||
// No related vids
|
// No related vids
|
||||||
showinfo: 0,
|
showinfo: 0,
|
||||||
// Hide info
|
// Hide info
|
||||||
iv_load_policy: 3,
|
iv_load_policy: 3,
|
||||||
// Hide annotations
|
// Hide annotations
|
||||||
modestbranding: 1 // Hide logos as much as possible (they still show one in the corner when paused)
|
modestbranding: 1,
|
||||||
|
// Hide logos as much as possible (they still show one in the corner when paused)
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
noCookie: false // Whether to use an alternative version of YouTube without cookies
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -4077,7 +4080,7 @@ var Fullscreen = /*#__PURE__*/function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_this.toggle();
|
_this.player.listeners.proxy(event, _this.toggle, 'fullscreen');
|
||||||
}); // Tap focus when in fullscreen
|
}); // Tap focus when in fullscreen
|
||||||
|
|
||||||
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
||||||
@ -4487,7 +4490,9 @@ var ui = {
|
|||||||
} // Set property synchronously to respect the call order
|
} // Set property synchronously to respect the call order
|
||||||
|
|
||||||
|
|
||||||
this.media.setAttribute('data-poster', poster); // Wait until ui is ready
|
this.media.setAttribute('data-poster', poster); // Show the poster
|
||||||
|
|
||||||
|
this.elements.poster.removeAttribute('hidden'); // Wait until ui is ready
|
||||||
|
|
||||||
return ready.call(this) // Load image
|
return ready.call(this) // Load image
|
||||||
.then(function () {
|
.then(function () {
|
||||||
@ -4919,7 +4924,14 @@ var Listeners = /*#__PURE__*/function () {
|
|||||||
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
||||||
|
|
||||||
|
|
||||||
setGutter(ratio, padding, isEnter); // If not using native browser fullscreen API, we need to check for resizes of viewport
|
setGutter(ratio, padding, isEnter); // Horrible hack for Safari 14 not repainting properly on entering fullscreen
|
||||||
|
|
||||||
|
if (isEnter) {
|
||||||
|
setTimeout(function () {
|
||||||
|
return repaint(elements.container);
|
||||||
|
}, 100);
|
||||||
|
} // If not using native browser fullscreen API, we need to check for resizes of viewport
|
||||||
|
|
||||||
|
|
||||||
if (!usingNative) {
|
if (!usingNative) {
|
||||||
if (isEnter) {
|
if (isEnter) {
|
||||||
@ -5110,9 +5122,17 @@ var Listeners = /*#__PURE__*/function () {
|
|||||||
|
|
||||||
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.rewind, 'click', player.rewind, 'rewind'); // Rewind
|
this.bind(elements.buttons.rewind, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after rewind
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.rewind();
|
||||||
|
}, 'rewind'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.fastForward, 'click', player.forward, 'fastForward'); // Mute toggle
|
this.bind(elements.buttons.fastForward, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after fast forward
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.forward();
|
||||||
|
}, 'fastForward'); // Mute toggle
|
||||||
|
|
||||||
this.bind(elements.buttons.mute, 'click', function () {
|
this.bind(elements.buttons.mute, 'click', function () {
|
||||||
player.muted = !player.muted;
|
player.muted = !player.muted;
|
||||||
@ -5767,35 +5787,32 @@ var vimeo = {
|
|||||||
} // Inject the package
|
} // Inject the package
|
||||||
|
|
||||||
|
|
||||||
var poster = player.poster;
|
if (premium || !config.customControls) {
|
||||||
|
iframe.setAttribute('data-poster', player.poster);
|
||||||
if (premium) {
|
|
||||||
iframe.setAttribute('data-poster', poster);
|
|
||||||
player.media = replaceElement(iframe, player.media);
|
player.media = replaceElement(iframe, player.media);
|
||||||
} else {
|
} else {
|
||||||
var wrapper = createElement('div', {
|
var wrapper = createElement('div', {
|
||||||
class: player.config.classNames.embedContainer,
|
class: player.config.classNames.embedContainer,
|
||||||
'data-poster': poster
|
'data-poster': player.poster
|
||||||
});
|
});
|
||||||
wrapper.appendChild(iframe);
|
wrapper.appendChild(iframe);
|
||||||
player.media = replaceElement(wrapper, player.media);
|
player.media = replaceElement(wrapper, player.media);
|
||||||
} // Get poster image
|
} // Get poster image
|
||||||
|
|
||||||
|
|
||||||
fetch(format(player.config.urls.vimeo.api, id), 'json').then(function (response) {
|
if (!config.customControls) {
|
||||||
if (is$1.empty(response)) {
|
fetch(format(player.config.urls.vimeo.api, src)).then(function (response) {
|
||||||
return;
|
if (is$1.empty(response) || !response.thumbnail_url) {
|
||||||
} // Get the URL for thumbnail
|
return;
|
||||||
|
} // Set and show poster
|
||||||
|
|
||||||
|
|
||||||
var url = new URL(response[0].thumbnail_large); // Get original image
|
ui.setPoster.call(player, response.thumbnail_url).catch(function () {});
|
||||||
|
});
|
||||||
url.pathname = "".concat(url.pathname.split('_')[0], ".jpg"); // Set and show poster
|
} // Setup instance
|
||||||
|
|
||||||
ui.setPoster.call(player, url.href).catch(function () {});
|
|
||||||
}); // Setup instance
|
|
||||||
// https://github.com/vimeo/player.js
|
// https://github.com/vimeo/player.js
|
||||||
|
|
||||||
|
|
||||||
player.embed = new window.Vimeo.Player(iframe, {
|
player.embed = new window.Vimeo.Player(iframe, {
|
||||||
autopause: player.config.autopause,
|
autopause: player.config.autopause,
|
||||||
muted: player.muted
|
muted: player.muted
|
||||||
@ -6035,9 +6052,11 @@ var vimeo = {
|
|||||||
triggerEvent.call(player, player.media, 'error');
|
triggerEvent.call(player, player.media, 'error');
|
||||||
}); // Rebuild UI
|
}); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 0);
|
return ui.build.call(player);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6130,7 +6149,8 @@ var youtube = {
|
|||||||
},
|
},
|
||||||
// API ready
|
// API ready
|
||||||
ready: function ready() {
|
ready: function ready() {
|
||||||
var player = this; // Ignore already setup (race condition)
|
var player = this;
|
||||||
|
var config = player.config.youtube; // Ignore already setup (race condition)
|
||||||
|
|
||||||
var currentId = player.media && player.media.getAttribute('id');
|
var currentId = player.media && player.media.getAttribute('id');
|
||||||
|
|
||||||
@ -6147,53 +6167,53 @@ var youtube = {
|
|||||||
|
|
||||||
|
|
||||||
var videoId = parseId$1(source);
|
var videoId = parseId$1(source);
|
||||||
var id = generateId(player.provider); // Get poster, if already set
|
var id = generateId(player.provider); // Replace media element
|
||||||
|
|
||||||
var poster = player.poster; // Replace media element
|
|
||||||
|
|
||||||
var container = createElement('div', {
|
var container = createElement('div', {
|
||||||
id: id,
|
id: id,
|
||||||
'data-poster': poster
|
'data-poster': config.customControls ? player.poster : undefined
|
||||||
});
|
});
|
||||||
player.media = replaceElement(container, player.media); // Id to poster wrapper
|
player.media = replaceElement(container, player.media); // Only load the poster when using custom controls
|
||||||
|
|
||||||
var posterSrc = function posterSrc(s) {
|
if (config.customControls) {
|
||||||
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
var posterSrc = function posterSrc(s) {
|
||||||
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
||||||
|
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
||||||
|
|
||||||
|
|
||||||
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('sd'), 121);
|
return loadImage(posterSrc('sd'), 121);
|
||||||
}) // 480p padded 4:3
|
}) // 480p padded 4:3
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('hq'));
|
return loadImage(posterSrc('hq'));
|
||||||
}) // 360p padded 4:3. Always exists
|
}) // 360p padded 4:3. Always exists
|
||||||
.then(function (image) {
|
.then(function (image) {
|
||||||
return ui.setPoster.call(player, image.src);
|
return ui.setPoster.call(player, image.src);
|
||||||
}).then(function (src) {
|
}).then(function (src) {
|
||||||
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
||||||
if (!src.includes('maxres')) {
|
if (!src.includes('maxres')) {
|
||||||
player.elements.poster.style.backgroundSize = 'cover';
|
player.elements.poster.style.backgroundSize = 'cover';
|
||||||
}
|
}
|
||||||
}).catch(function () {});
|
}).catch(function () {});
|
||||||
var config = player.config.youtube; // Setup instance
|
} // Setup instance
|
||||||
// https://developers.google.com/youtube/iframe_api_reference
|
// https://developers.google.com/youtube/iframe_api_reference
|
||||||
|
|
||||||
player.embed = new window.YT.Player(id, {
|
|
||||||
|
player.embed = new window.YT.Player(player.media, {
|
||||||
videoId: videoId,
|
videoId: videoId,
|
||||||
host: getHost(config),
|
host: getHost(config),
|
||||||
playerVars: extend({}, {
|
playerVars: extend({}, {
|
||||||
autoplay: player.config.autoplay ? 1 : 0,
|
|
||||||
// Autoplay
|
// Autoplay
|
||||||
hl: player.config.hl,
|
autoplay: player.config.autoplay ? 1 : 0,
|
||||||
// iframe interface language
|
// iframe interface language
|
||||||
controls: player.supported.ui ? 0 : 1,
|
hl: player.config.hl,
|
||||||
// Only show controls if not fully supported
|
// Only show controls if not fully supported or opted out
|
||||||
disablekb: 1,
|
controls: player.supported.ui && config.customControls ? 0 : 1,
|
||||||
// Disable keyboard as we handle it
|
// Disable keyboard as we handle it
|
||||||
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
disablekb: 1,
|
||||||
// Allow iOS inline playback
|
// Allow iOS inline playback
|
||||||
|
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
||||||
// Captions are flaky on YouTube
|
// Captions are flaky on YouTube
|
||||||
cc_load_policy: player.captions.active ? 1 : 0,
|
cc_load_policy: player.captions.active ? 1 : 0,
|
||||||
cc_lang_pref: player.config.captions.language,
|
cc_lang_pref: player.config.captions.language,
|
||||||
@ -6304,6 +6324,7 @@ var youtube = {
|
|||||||
var toggle = is$1.boolean(input) ? input : muted;
|
var toggle = is$1.boolean(input) ? input : muted;
|
||||||
muted = toggle;
|
muted = toggle;
|
||||||
instance[toggle ? 'mute' : 'unMute']();
|
instance[toggle ? 'mute' : 'unMute']();
|
||||||
|
instance.setVolume(volume * 100);
|
||||||
triggerEvent.call(player, player.media, 'volumechange');
|
triggerEvent.call(player, player.media, 'volumechange');
|
||||||
}
|
}
|
||||||
}); // Source
|
}); // Source
|
||||||
@ -6326,7 +6347,7 @@ var youtube = {
|
|||||||
return player.config.speed.options.includes(s);
|
return player.config.speed.options.includes(s);
|
||||||
}); // Set the tabindex to avoid focus entering iframe
|
}); // Set the tabindex to avoid focus entering iframe
|
||||||
|
|
||||||
if (player.supported.ui) {
|
if (player.supported.ui && config.customControls) {
|
||||||
player.media.setAttribute('tabindex', -1);
|
player.media.setAttribute('tabindex', -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6353,9 +6374,11 @@ var youtube = {
|
|||||||
}
|
}
|
||||||
}, 200); // Rebuild UI
|
}, 200); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 50);
|
return ui.build.call(player);
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onStateChange: function onStateChange(event) {
|
onStateChange: function onStateChange(event) {
|
||||||
// Get the instance
|
// Get the instance
|
||||||
@ -6401,7 +6424,7 @@ var youtube = {
|
|||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
||||||
if (!player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
if (config.customControls && !player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
||||||
player.media.pause();
|
player.media.pause();
|
||||||
} else {
|
} else {
|
||||||
assurePlaybackState$1.call(player, true);
|
assurePlaybackState$1.call(player, true);
|
||||||
@ -6475,7 +6498,8 @@ var media = {
|
|||||||
wrap(this.media, this.elements.wrapper); // Poster image container
|
wrap(this.media, this.elements.wrapper); // Poster image container
|
||||||
|
|
||||||
this.elements.poster = createElement('div', {
|
this.elements.poster = createElement('div', {
|
||||||
class: this.config.classNames.poster
|
class: this.config.classNames.poster,
|
||||||
|
hidden: ''
|
||||||
});
|
});
|
||||||
this.elements.wrapper.appendChild(this.elements.poster);
|
this.elements.wrapper.appendChild(this.elements.poster);
|
||||||
}
|
}
|
||||||
|
347
dist/plyr.polyfilled.js
vendored
347
dist/plyr.polyfilled.js
vendored
@ -74,7 +74,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
check(typeof self == 'object' && self) ||
|
check(typeof self == 'object' && self) ||
|
||||||
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
||||||
// eslint-disable-next-line no-new-func
|
// eslint-disable-next-line no-new-func
|
||||||
Function('return this')();
|
(function () { return this; })() || Function('return this')();
|
||||||
|
|
||||||
var fails = function (exec) {
|
var fails = function (exec) {
|
||||||
try {
|
try {
|
||||||
@ -269,7 +269,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
(module.exports = function (key, value) {
|
(module.exports = function (key, value) {
|
||||||
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
||||||
})('versions', []).push({
|
})('versions', []).push({
|
||||||
version: '3.6.5',
|
version: '3.7.0',
|
||||||
mode: 'global',
|
mode: 'global',
|
||||||
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
||||||
});
|
});
|
||||||
@ -307,11 +307,12 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (nativeWeakMap) {
|
if (nativeWeakMap) {
|
||||||
var store$1 = new WeakMap$2();
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
||||||
var wmget = store$1.get;
|
var wmget = store$1.get;
|
||||||
var wmhas = store$1.has;
|
var wmhas = store$1.has;
|
||||||
var wmset = store$1.set;
|
var wmset = store$1.set;
|
||||||
set = function (it, metadata) {
|
set = function (it, metadata) {
|
||||||
|
metadata.facade = it;
|
||||||
wmset.call(store$1, it, metadata);
|
wmset.call(store$1, it, metadata);
|
||||||
return metadata;
|
return metadata;
|
||||||
};
|
};
|
||||||
@ -325,6 +326,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var STATE = sharedKey('state');
|
var STATE = sharedKey('state');
|
||||||
hiddenKeys[STATE] = true;
|
hiddenKeys[STATE] = true;
|
||||||
set = function (it, metadata) {
|
set = function (it, metadata) {
|
||||||
|
metadata.facade = it;
|
||||||
createNonEnumerableProperty(it, STATE, metadata);
|
createNonEnumerableProperty(it, STATE, metadata);
|
||||||
return metadata;
|
return metadata;
|
||||||
};
|
};
|
||||||
@ -353,9 +355,15 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var unsafe = options ? !!options.unsafe : false;
|
var unsafe = options ? !!options.unsafe : false;
|
||||||
var simple = options ? !!options.enumerable : false;
|
var simple = options ? !!options.enumerable : false;
|
||||||
var noTargetGet = options ? !!options.noTargetGet : false;
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
||||||
|
var state;
|
||||||
if (typeof value == 'function') {
|
if (typeof value == 'function') {
|
||||||
if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
|
if (typeof key == 'string' && !has(value, 'name')) {
|
||||||
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
createNonEnumerableProperty(value, 'name', key);
|
||||||
|
}
|
||||||
|
state = enforceInternalState(value);
|
||||||
|
if (!state.source) {
|
||||||
|
state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (O === global_1) {
|
if (O === global_1) {
|
||||||
if (simple) O[key] = value;
|
if (simple) O[key] = value;
|
||||||
@ -2441,14 +2449,20 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
} return T;
|
} return T;
|
||||||
} : nativeAssign;
|
} : nativeAssign;
|
||||||
|
|
||||||
|
var iteratorClose = function (iterator) {
|
||||||
|
var returnMethod = iterator['return'];
|
||||||
|
if (returnMethod !== undefined) {
|
||||||
|
return anObject(returnMethod.call(iterator)).value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// call something on iterator step with safe closing on error
|
// call something on iterator step with safe closing on error
|
||||||
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
||||||
try {
|
try {
|
||||||
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
||||||
// 7.4.6 IteratorClose(iterator, completion)
|
// 7.4.6 IteratorClose(iterator, completion)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
var returnMethod = iterator['return'];
|
iteratorClose(iterator);
|
||||||
if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
|
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -2845,7 +2859,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
||||||
|
|
||||||
redefineAll(URLSearchParamsPrototype, {
|
redefineAll(URLSearchParamsPrototype, {
|
||||||
// `URLSearchParams.prototype.appent` method
|
// `URLSearchParams.prototype.append` method
|
||||||
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
||||||
append: function append(name, value) {
|
append: function append(name, value) {
|
||||||
validateArgumentsLength(arguments.length, 2);
|
validateArgumentsLength(arguments.length, 2);
|
||||||
@ -4506,12 +4520,14 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var _URL = global.URL;
|
var _URL = global.URL;
|
||||||
|
|
||||||
var URL = function URL(url, base) {
|
var URL = function URL(url, base) {
|
||||||
if (typeof url !== 'string') url = String(url); // Only create another document if the base is different from current location.
|
if (typeof url !== 'string') url = String(url);
|
||||||
|
if (base && typeof base !== 'string') base = String(base); // Only create another document if the base is different from current location.
|
||||||
|
|
||||||
var doc = document,
|
var doc = document,
|
||||||
baseElement;
|
baseElement;
|
||||||
|
|
||||||
if (base && (global.location === void 0 || base !== global.location.href)) {
|
if (base && (global.location === void 0 || base !== global.location.href)) {
|
||||||
|
base = base.toLowerCase();
|
||||||
doc = document.implementation.createHTMLDocument('');
|
doc = document.implementation.createHTMLDocument('');
|
||||||
baseElement = doc.createElement('base');
|
baseElement = doc.createElement('base');
|
||||||
baseElement.href = base;
|
baseElement.href = base;
|
||||||
@ -5017,11 +5033,11 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var regexp = /./;
|
var regexp = /./;
|
||||||
try {
|
try {
|
||||||
'/./'[METHOD_NAME](regexp);
|
'/./'[METHOD_NAME](regexp);
|
||||||
} catch (e) {
|
} catch (error1) {
|
||||||
try {
|
try {
|
||||||
regexp[MATCH$1] = false;
|
regexp[MATCH$1] = false;
|
||||||
return '/./'[METHOD_NAME](regexp);
|
return '/./'[METHOD_NAME](regexp);
|
||||||
} catch (f) { /* empty */ }
|
} catch (error2) { /* empty */ }
|
||||||
} return false;
|
} return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5103,16 +5119,31 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var internalMetadata_3 = internalMetadata.getWeakData;
|
var internalMetadata_3 = internalMetadata.getWeakData;
|
||||||
var internalMetadata_4 = internalMetadata.onFreeze;
|
var internalMetadata_4 = internalMetadata.onFreeze;
|
||||||
|
|
||||||
var iterate_1 = createCommonjsModule(function (module) {
|
|
||||||
var Result = function (stopped, result) {
|
var Result = function (stopped, result) {
|
||||||
this.stopped = stopped;
|
this.stopped = stopped;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
};
|
};
|
||||||
|
|
||||||
var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
|
var iterate = function (iterable, unboundFunction, options) {
|
||||||
var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1);
|
var that = options && options.that;
|
||||||
|
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
||||||
|
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
||||||
|
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
||||||
|
var fn = functionBindContext(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
|
||||||
var iterator, iterFn, index, length, result, next, step;
|
var iterator, iterFn, index, length, result, next, step;
|
||||||
|
|
||||||
|
var stop = function (condition) {
|
||||||
|
if (iterator) iteratorClose(iterator);
|
||||||
|
return new Result(true, condition);
|
||||||
|
};
|
||||||
|
|
||||||
|
var callFn = function (value) {
|
||||||
|
if (AS_ENTRIES) {
|
||||||
|
anObject(value);
|
||||||
|
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
||||||
|
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
||||||
|
};
|
||||||
|
|
||||||
if (IS_ITERATOR) {
|
if (IS_ITERATOR) {
|
||||||
iterator = iterable;
|
iterator = iterable;
|
||||||
} else {
|
} else {
|
||||||
@ -5121,9 +5152,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
// optimisation for array iterators
|
// optimisation for array iterators
|
||||||
if (isArrayIteratorMethod(iterFn)) {
|
if (isArrayIteratorMethod(iterFn)) {
|
||||||
for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
||||||
result = AS_ENTRIES
|
result = callFn(iterable[index]);
|
||||||
? boundFunction(anObject(step = iterable[index])[0], step[1])
|
|
||||||
: boundFunction(iterable[index]);
|
|
||||||
if (result && result instanceof Result) return result;
|
if (result && result instanceof Result) return result;
|
||||||
} return new Result(false);
|
} return new Result(false);
|
||||||
}
|
}
|
||||||
@ -5132,16 +5161,16 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
next = iterator.next;
|
next = iterator.next;
|
||||||
while (!(step = next.call(iterator)).done) {
|
while (!(step = next.call(iterator)).done) {
|
||||||
result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
|
try {
|
||||||
|
result = callFn(step.value);
|
||||||
|
} catch (error) {
|
||||||
|
iteratorClose(iterator);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
if (typeof result == 'object' && result && result instanceof Result) return result;
|
if (typeof result == 'object' && result && result instanceof Result) return result;
|
||||||
} return new Result(false);
|
} return new Result(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
iterate.stop = function (result) {
|
|
||||||
return new Result(true, result);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
||||||
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
||||||
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
||||||
@ -5199,7 +5228,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
Constructor = wrapper(function (dummy, iterable) {
|
Constructor = wrapper(function (dummy, iterable) {
|
||||||
anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
||||||
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
||||||
if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
||||||
return that;
|
return that;
|
||||||
});
|
});
|
||||||
Constructor.prototype = NativePrototype;
|
Constructor.prototype = NativePrototype;
|
||||||
@ -5289,7 +5318,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
id: id$1++,
|
id: id$1++,
|
||||||
frozen: undefined
|
frozen: undefined
|
||||||
});
|
});
|
||||||
if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
||||||
});
|
});
|
||||||
|
|
||||||
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
||||||
@ -5978,6 +6007,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
|
var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
|
||||||
|
|
||||||
|
var engineIsNode = classofRaw(global_1.process) == 'process';
|
||||||
|
|
||||||
var location = global_1.location;
|
var location = global_1.location;
|
||||||
var set$1 = global_1.setImmediate;
|
var set$1 = global_1.setImmediate;
|
||||||
var clear = global_1.clearImmediate;
|
var clear = global_1.clearImmediate;
|
||||||
@ -6030,7 +6061,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
delete queue[id];
|
delete queue[id];
|
||||||
};
|
};
|
||||||
// Node.js 0.8-
|
// Node.js 0.8-
|
||||||
if (classofRaw(process$1) == 'process') {
|
if (engineIsNode) {
|
||||||
defer = function (id) {
|
defer = function (id) {
|
||||||
process$1.nextTick(runner(id));
|
process$1.nextTick(runner(id));
|
||||||
};
|
};
|
||||||
@ -6052,8 +6083,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
global_1.addEventListener &&
|
global_1.addEventListener &&
|
||||||
typeof postMessage == 'function' &&
|
typeof postMessage == 'function' &&
|
||||||
!global_1.importScripts &&
|
!global_1.importScripts &&
|
||||||
!fails(post) &&
|
location && location.protocol !== 'file:' &&
|
||||||
location.protocol !== 'file:'
|
!fails(post)
|
||||||
) {
|
) {
|
||||||
defer = post;
|
defer = post;
|
||||||
global_1.addEventListener('message', listener, false);
|
global_1.addEventListener('message', listener, false);
|
||||||
@ -6079,14 +6110,14 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
||||||
|
|
||||||
var macrotask = task.set;
|
var macrotask = task.set;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var MutationObserver$1 = global_1.MutationObserver || global_1.WebKitMutationObserver;
|
var MutationObserver$1 = global_1.MutationObserver || global_1.WebKitMutationObserver;
|
||||||
|
var document$2 = global_1.document;
|
||||||
var process$2 = global_1.process;
|
var process$2 = global_1.process;
|
||||||
var Promise$1 = global_1.Promise;
|
var Promise$1 = global_1.Promise;
|
||||||
var IS_NODE = classofRaw(process$2) == 'process';
|
|
||||||
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
||||||
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global_1, 'queueMicrotask');
|
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global_1, 'queueMicrotask');
|
||||||
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
||||||
@ -6097,7 +6128,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
if (!queueMicrotask) {
|
if (!queueMicrotask) {
|
||||||
flush = function () {
|
flush = function () {
|
||||||
var parent, fn;
|
var parent, fn;
|
||||||
if (IS_NODE && (parent = process$2.domain)) parent.exit();
|
if (engineIsNode && (parent = process$2.domain)) parent.exit();
|
||||||
while (head) {
|
while (head) {
|
||||||
fn = head.fn;
|
fn = head.fn;
|
||||||
head = head.next;
|
head = head.next;
|
||||||
@ -6112,15 +6143,10 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
if (parent) parent.enter();
|
if (parent) parent.enter();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Node.js
|
|
||||||
if (IS_NODE) {
|
|
||||||
notify = function () {
|
|
||||||
process$2.nextTick(flush);
|
|
||||||
};
|
|
||||||
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
||||||
} else if (MutationObserver$1 && !engineIsIos) {
|
if (!engineIsIos && !engineIsNode && MutationObserver$1 && document$2) {
|
||||||
toggle = true;
|
toggle = true;
|
||||||
node = document.createTextNode('');
|
node = document$2.createTextNode('');
|
||||||
new MutationObserver$1(flush).observe(node, { characterData: true });
|
new MutationObserver$1(flush).observe(node, { characterData: true });
|
||||||
notify = function () {
|
notify = function () {
|
||||||
node.data = toggle = !toggle;
|
node.data = toggle = !toggle;
|
||||||
@ -6133,6 +6159,11 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
notify = function () {
|
notify = function () {
|
||||||
then.call(promise, flush);
|
then.call(promise, flush);
|
||||||
};
|
};
|
||||||
|
// Node.js without promises
|
||||||
|
} else if (engineIsNode) {
|
||||||
|
notify = function () {
|
||||||
|
process$2.nextTick(flush);
|
||||||
|
};
|
||||||
// for other environments - macrotask based on:
|
// for other environments - macrotask based on:
|
||||||
// - setImmediate
|
// - setImmediate
|
||||||
// - MessageChannel
|
// - MessageChannel
|
||||||
@ -6211,6 +6242,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var SPECIES$6 = wellKnownSymbol('species');
|
var SPECIES$6 = wellKnownSymbol('species');
|
||||||
var PROMISE = 'Promise';
|
var PROMISE = 'Promise';
|
||||||
var getInternalState$3 = internalState.get;
|
var getInternalState$3 = internalState.get;
|
||||||
@ -6218,13 +6250,13 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
||||||
var PromiseConstructor = nativePromiseConstructor;
|
var PromiseConstructor = nativePromiseConstructor;
|
||||||
var TypeError$1 = global_1.TypeError;
|
var TypeError$1 = global_1.TypeError;
|
||||||
var document$2 = global_1.document;
|
var document$3 = global_1.document;
|
||||||
var process$3 = global_1.process;
|
var process$3 = global_1.process;
|
||||||
var $fetch$1 = getBuiltIn('fetch');
|
var $fetch$1 = getBuiltIn('fetch');
|
||||||
var newPromiseCapability$1 = newPromiseCapability.f;
|
var newPromiseCapability$1 = newPromiseCapability.f;
|
||||||
var newGenericPromiseCapability = newPromiseCapability$1;
|
var newGenericPromiseCapability = newPromiseCapability$1;
|
||||||
var IS_NODE$1 = classofRaw(process$3) == 'process';
|
var DISPATCH_EVENT = !!(document$3 && document$3.createEvent && global_1.dispatchEvent);
|
||||||
var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent);
|
var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
|
||||||
var UNHANDLED_REJECTION = 'unhandledrejection';
|
var UNHANDLED_REJECTION = 'unhandledrejection';
|
||||||
var REJECTION_HANDLED = 'rejectionhandled';
|
var REJECTION_HANDLED = 'rejectionhandled';
|
||||||
var PENDING = 0;
|
var PENDING = 0;
|
||||||
@ -6242,7 +6274,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
// We can't detect it synchronously, so just check versions
|
// We can't detect it synchronously, so just check versions
|
||||||
if (engineV8Version === 66) return true;
|
if (engineV8Version === 66) return true;
|
||||||
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
||||||
if (!IS_NODE$1 && typeof PromiseRejectionEvent != 'function') return true;
|
if (!engineIsNode && !NATIVE_REJECTION_EVENT) return true;
|
||||||
}
|
}
|
||||||
// We can't use @@species feature detection in V8 since it causes
|
// We can't use @@species feature detection in V8 since it causes
|
||||||
// deoptimization and performance degradation
|
// deoptimization and performance degradation
|
||||||
@ -6268,7 +6300,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var notify$1 = function (promise, state, isReject) {
|
var notify$1 = function (state, isReject) {
|
||||||
if (state.notified) return;
|
if (state.notified) return;
|
||||||
state.notified = true;
|
state.notified = true;
|
||||||
var chain = state.reactions;
|
var chain = state.reactions;
|
||||||
@ -6287,7 +6319,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
try {
|
try {
|
||||||
if (handler) {
|
if (handler) {
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
|
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
||||||
state.rejection = HANDLED;
|
state.rejection = HANDLED;
|
||||||
}
|
}
|
||||||
if (handler === true) result = value;
|
if (handler === true) result = value;
|
||||||
@ -6312,36 +6344,37 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
}
|
}
|
||||||
state.reactions = [];
|
state.reactions = [];
|
||||||
state.notified = false;
|
state.notified = false;
|
||||||
if (isReject && !state.rejection) onUnhandled(promise, state);
|
if (isReject && !state.rejection) onUnhandled(state);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var dispatchEvent = function (name, promise, reason) {
|
var dispatchEvent = function (name, promise, reason) {
|
||||||
var event, handler;
|
var event, handler;
|
||||||
if (DISPATCH_EVENT) {
|
if (DISPATCH_EVENT) {
|
||||||
event = document$2.createEvent('Event');
|
event = document$3.createEvent('Event');
|
||||||
event.promise = promise;
|
event.promise = promise;
|
||||||
event.reason = reason;
|
event.reason = reason;
|
||||||
event.initEvent(name, false, true);
|
event.initEvent(name, false, true);
|
||||||
global_1.dispatchEvent(event);
|
global_1.dispatchEvent(event);
|
||||||
} else event = { promise: promise, reason: reason };
|
} else event = { promise: promise, reason: reason };
|
||||||
if (handler = global_1['on' + name]) handler(event);
|
if (!NATIVE_REJECTION_EVENT && (handler = global_1['on' + name])) handler(event);
|
||||||
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onUnhandled = function (promise, state) {
|
var onUnhandled = function (state) {
|
||||||
task$1.call(global_1, function () {
|
task$1.call(global_1, function () {
|
||||||
|
var promise = state.facade;
|
||||||
var value = state.value;
|
var value = state.value;
|
||||||
var IS_UNHANDLED = isUnhandled(state);
|
var IS_UNHANDLED = isUnhandled(state);
|
||||||
var result;
|
var result;
|
||||||
if (IS_UNHANDLED) {
|
if (IS_UNHANDLED) {
|
||||||
result = perform(function () {
|
result = perform(function () {
|
||||||
if (IS_NODE$1) {
|
if (engineIsNode) {
|
||||||
process$3.emit('unhandledRejection', value, promise);
|
process$3.emit('unhandledRejection', value, promise);
|
||||||
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
||||||
});
|
});
|
||||||
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
||||||
state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
|
state.rejection = engineIsNode || isUnhandled(state) ? UNHANDLED : HANDLED;
|
||||||
if (result.error) throw result.value;
|
if (result.error) throw result.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -6351,55 +6384,56 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
return state.rejection !== HANDLED && !state.parent;
|
return state.rejection !== HANDLED && !state.parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
var onHandleUnhandled = function (promise, state) {
|
var onHandleUnhandled = function (state) {
|
||||||
task$1.call(global_1, function () {
|
task$1.call(global_1, function () {
|
||||||
if (IS_NODE$1) {
|
var promise = state.facade;
|
||||||
|
if (engineIsNode) {
|
||||||
process$3.emit('rejectionHandled', promise);
|
process$3.emit('rejectionHandled', promise);
|
||||||
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var bind = function (fn, promise, state, unwrap) {
|
var bind = function (fn, state, unwrap) {
|
||||||
return function (value) {
|
return function (value) {
|
||||||
fn(promise, state, value, unwrap);
|
fn(state, value, unwrap);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var internalReject = function (promise, state, value, unwrap) {
|
var internalReject = function (state, value, unwrap) {
|
||||||
if (state.done) return;
|
if (state.done) return;
|
||||||
state.done = true;
|
state.done = true;
|
||||||
if (unwrap) state = unwrap;
|
if (unwrap) state = unwrap;
|
||||||
state.value = value;
|
state.value = value;
|
||||||
state.state = REJECTED;
|
state.state = REJECTED;
|
||||||
notify$1(promise, state, true);
|
notify$1(state, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
var internalResolve = function (promise, state, value, unwrap) {
|
var internalResolve = function (state, value, unwrap) {
|
||||||
if (state.done) return;
|
if (state.done) return;
|
||||||
state.done = true;
|
state.done = true;
|
||||||
if (unwrap) state = unwrap;
|
if (unwrap) state = unwrap;
|
||||||
try {
|
try {
|
||||||
if (promise === value) throw TypeError$1("Promise can't be resolved itself");
|
if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
|
||||||
var then = isThenable(value);
|
var then = isThenable(value);
|
||||||
if (then) {
|
if (then) {
|
||||||
microtask(function () {
|
microtask(function () {
|
||||||
var wrapper = { done: false };
|
var wrapper = { done: false };
|
||||||
try {
|
try {
|
||||||
then.call(value,
|
then.call(value,
|
||||||
bind(internalResolve, promise, wrapper, state),
|
bind(internalResolve, wrapper, state),
|
||||||
bind(internalReject, promise, wrapper, state)
|
bind(internalReject, wrapper, state)
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
internalReject(promise, wrapper, error, state);
|
internalReject(wrapper, error, state);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
state.value = value;
|
state.value = value;
|
||||||
state.state = FULFILLED;
|
state.state = FULFILLED;
|
||||||
notify$1(promise, state, false);
|
notify$1(state, false);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
internalReject(promise, { done: false }, error, state);
|
internalReject({ done: false }, error, state);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6412,9 +6446,9 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
Internal.call(this);
|
Internal.call(this);
|
||||||
var state = getInternalState$3(this);
|
var state = getInternalState$3(this);
|
||||||
try {
|
try {
|
||||||
executor(bind(internalResolve, this, state), bind(internalReject, this, state));
|
executor(bind(internalResolve, state), bind(internalReject, state));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
internalReject(this, state, error);
|
internalReject(state, error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
@ -6438,10 +6472,10 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
|
var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
|
||||||
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
||||||
reaction.fail = typeof onRejected == 'function' && onRejected;
|
reaction.fail = typeof onRejected == 'function' && onRejected;
|
||||||
reaction.domain = IS_NODE$1 ? process$3.domain : undefined;
|
reaction.domain = engineIsNode ? process$3.domain : undefined;
|
||||||
state.parent = true;
|
state.parent = true;
|
||||||
state.reactions.push(reaction);
|
state.reactions.push(reaction);
|
||||||
if (state.state != PENDING) notify$1(this, state, false);
|
if (state.state != PENDING) notify$1(state, false);
|
||||||
return reaction.promise;
|
return reaction.promise;
|
||||||
},
|
},
|
||||||
// `Promise.prototype.catch` method
|
// `Promise.prototype.catch` method
|
||||||
@ -6454,8 +6488,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var promise = new Internal();
|
var promise = new Internal();
|
||||||
var state = getInternalState$3(promise);
|
var state = getInternalState$3(promise);
|
||||||
this.promise = promise;
|
this.promise = promise;
|
||||||
this.resolve = bind(internalResolve, promise, state);
|
this.resolve = bind(internalResolve, state);
|
||||||
this.reject = bind(internalReject, promise, state);
|
this.reject = bind(internalReject, state);
|
||||||
};
|
};
|
||||||
newPromiseCapability.f = newPromiseCapability$1 = function (C) {
|
newPromiseCapability.f = newPromiseCapability$1 = function (C) {
|
||||||
return C === PromiseConstructor || C === PromiseWrapper
|
return C === PromiseConstructor || C === PromiseWrapper
|
||||||
@ -6526,7 +6560,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var values = [];
|
var values = [];
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
var remaining = 1;
|
var remaining = 1;
|
||||||
iterate_1(iterable, function (promise) {
|
iterate(iterable, function (promise) {
|
||||||
var index = counter++;
|
var index = counter++;
|
||||||
var alreadyCalled = false;
|
var alreadyCalled = false;
|
||||||
values.push(undefined);
|
values.push(undefined);
|
||||||
@ -6551,7 +6585,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var reject = capability.reject;
|
var reject = capability.reject;
|
||||||
var result = perform(function () {
|
var result = perform(function () {
|
||||||
var $promiseResolve = aFunction$1(C.resolve);
|
var $promiseResolve = aFunction$1(C.resolve);
|
||||||
iterate_1(iterable, function (promise) {
|
iterate(iterable, function (promise) {
|
||||||
$promiseResolve.call(C, promise).then(capability.resolve, reject);
|
$promiseResolve.call(C, promise).then(capability.resolve, reject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -6798,12 +6832,17 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var STRICT_METHOD$5 = arrayMethodIsStrict('reduce');
|
var STRICT_METHOD$5 = arrayMethodIsStrict('reduce');
|
||||||
var USES_TO_LENGTH$9 = arrayMethodUsesToLength('reduce', { 1: 0 });
|
var USES_TO_LENGTH$9 = arrayMethodUsesToLength('reduce', { 1: 0 });
|
||||||
|
// Chrome 80-82 has a critical bug
|
||||||
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
||||||
|
var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
|
||||||
|
|
||||||
// `Array.prototype.reduce` method
|
// `Array.prototype.reduce` method
|
||||||
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
||||||
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$9 }, {
|
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$9 || CHROME_BUG }, {
|
||||||
reduce: function reduce(callbackfn /* , initialValue */) {
|
reduce: function reduce(callbackfn /* , initialValue */) {
|
||||||
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
||||||
}
|
}
|
||||||
@ -9984,7 +10023,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
// Sprite (for icons)
|
// Sprite (for icons)
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/3.6.2/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/3.6.3/plyr.svg',
|
||||||
// Blank video (used to prevent errors on source change)
|
// Blank video (used to prevent errors on source change)
|
||||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||||
// Quality default
|
// Quality default
|
||||||
@ -10102,7 +10141,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
vimeo: {
|
vimeo: {
|
||||||
sdk: 'https://player.vimeo.com/api/player.js',
|
sdk: 'https://player.vimeo.com/api/player.js',
|
||||||
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
||||||
api: 'https://vimeo.com/api/v2/video/{0}.json'
|
api: 'https://vimeo.com/api/oembed.json?url={0}'
|
||||||
},
|
},
|
||||||
youtube: {
|
youtube: {
|
||||||
sdk: 'https://www.youtube.com/iframe_api',
|
sdk: 'https://www.youtube.com/iframe_api',
|
||||||
@ -10272,24 +10311,27 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
title: false,
|
title: false,
|
||||||
speed: true,
|
speed: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
referrerPolicy: null,
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
||||||
// Whether the owner of the video has a Pro or Business account
|
// Whether the owner of the video has a Pro or Business account
|
||||||
// (which allows us to properly hide controls without CSS hacks, etc)
|
// (which allows us to properly hide controls without CSS hacks, etc)
|
||||||
premium: false,
|
premium: false
|
||||||
// Custom settings from Plyr
|
|
||||||
referrerPolicy: null // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// YouTube plugin
|
// YouTube plugin
|
||||||
youtube: {
|
youtube: {
|
||||||
noCookie: true,
|
|
||||||
// Whether to use an alternative version of YouTube without cookies
|
|
||||||
rel: 0,
|
rel: 0,
|
||||||
// No related vids
|
// No related vids
|
||||||
showinfo: 0,
|
showinfo: 0,
|
||||||
// Hide info
|
// Hide info
|
||||||
iv_load_policy: 3,
|
iv_load_policy: 3,
|
||||||
// Hide annotations
|
// Hide annotations
|
||||||
modestbranding: 1 // Hide logos as much as possible (they still show one in the corner when paused)
|
modestbranding: 1,
|
||||||
|
// Hide logos as much as possible (they still show one in the corner when paused)
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
noCookie: false // Whether to use an alternative version of YouTube without cookies
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -10408,7 +10450,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_this.toggle();
|
_this.player.listeners.proxy(event, _this.toggle, 'fullscreen');
|
||||||
}); // Tap focus when in fullscreen
|
}); // Tap focus when in fullscreen
|
||||||
|
|
||||||
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
||||||
@ -10831,7 +10873,9 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
} // Set property synchronously to respect the call order
|
} // Set property synchronously to respect the call order
|
||||||
|
|
||||||
|
|
||||||
this.media.setAttribute('data-poster', poster); // Wait until ui is ready
|
this.media.setAttribute('data-poster', poster); // Show the poster
|
||||||
|
|
||||||
|
this.elements.poster.removeAttribute('hidden'); // Wait until ui is ready
|
||||||
|
|
||||||
return ready.call(this) // Load image
|
return ready.call(this) // Load image
|
||||||
.then(function () {
|
.then(function () {
|
||||||
@ -11263,7 +11307,14 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
||||||
|
|
||||||
|
|
||||||
setGutter(ratio, padding, isEnter); // If not using native browser fullscreen API, we need to check for resizes of viewport
|
setGutter(ratio, padding, isEnter); // Horrible hack for Safari 14 not repainting properly on entering fullscreen
|
||||||
|
|
||||||
|
if (isEnter) {
|
||||||
|
setTimeout(function () {
|
||||||
|
return repaint(elements.container);
|
||||||
|
}, 100);
|
||||||
|
} // If not using native browser fullscreen API, we need to check for resizes of viewport
|
||||||
|
|
||||||
|
|
||||||
if (!usingNative) {
|
if (!usingNative) {
|
||||||
if (isEnter) {
|
if (isEnter) {
|
||||||
@ -11454,9 +11505,17 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.rewind, 'click', player.rewind, 'rewind'); // Rewind
|
this.bind(elements.buttons.rewind, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after rewind
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.rewind();
|
||||||
|
}, 'rewind'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.fastForward, 'click', player.forward, 'fastForward'); // Mute toggle
|
this.bind(elements.buttons.fastForward, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after fast forward
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.forward();
|
||||||
|
}, 'fastForward'); // Mute toggle
|
||||||
|
|
||||||
this.bind(elements.buttons.mute, 'click', function () {
|
this.bind(elements.buttons.mute, 'click', function () {
|
||||||
player.muted = !player.muted;
|
player.muted = !player.muted;
|
||||||
@ -12164,35 +12223,32 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
} // Inject the package
|
} // Inject the package
|
||||||
|
|
||||||
|
|
||||||
var poster = player.poster;
|
if (premium || !config.customControls) {
|
||||||
|
iframe.setAttribute('data-poster', player.poster);
|
||||||
if (premium) {
|
|
||||||
iframe.setAttribute('data-poster', poster);
|
|
||||||
player.media = replaceElement(iframe, player.media);
|
player.media = replaceElement(iframe, player.media);
|
||||||
} else {
|
} else {
|
||||||
var wrapper = createElement('div', {
|
var wrapper = createElement('div', {
|
||||||
class: player.config.classNames.embedContainer,
|
class: player.config.classNames.embedContainer,
|
||||||
'data-poster': poster
|
'data-poster': player.poster
|
||||||
});
|
});
|
||||||
wrapper.appendChild(iframe);
|
wrapper.appendChild(iframe);
|
||||||
player.media = replaceElement(wrapper, player.media);
|
player.media = replaceElement(wrapper, player.media);
|
||||||
} // Get poster image
|
} // Get poster image
|
||||||
|
|
||||||
|
|
||||||
fetch(format(player.config.urls.vimeo.api, id), 'json').then(function (response) {
|
if (!config.customControls) {
|
||||||
if (is$1.empty(response)) {
|
fetch(format(player.config.urls.vimeo.api, src)).then(function (response) {
|
||||||
return;
|
if (is$1.empty(response) || !response.thumbnail_url) {
|
||||||
} // Get the URL for thumbnail
|
return;
|
||||||
|
} // Set and show poster
|
||||||
|
|
||||||
|
|
||||||
var url = new URL(response[0].thumbnail_large); // Get original image
|
ui.setPoster.call(player, response.thumbnail_url).catch(function () {});
|
||||||
|
});
|
||||||
url.pathname = "".concat(url.pathname.split('_')[0], ".jpg"); // Set and show poster
|
} // Setup instance
|
||||||
|
|
||||||
ui.setPoster.call(player, url.href).catch(function () {});
|
|
||||||
}); // Setup instance
|
|
||||||
// https://github.com/vimeo/player.js
|
// https://github.com/vimeo/player.js
|
||||||
|
|
||||||
|
|
||||||
player.embed = new window.Vimeo.Player(iframe, {
|
player.embed = new window.Vimeo.Player(iframe, {
|
||||||
autopause: player.config.autopause,
|
autopause: player.config.autopause,
|
||||||
muted: player.muted
|
muted: player.muted
|
||||||
@ -12432,9 +12488,11 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
triggerEvent.call(player, player.media, 'error');
|
triggerEvent.call(player, player.media, 'error');
|
||||||
}); // Rebuild UI
|
}); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 0);
|
return ui.build.call(player);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -12525,7 +12583,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
},
|
},
|
||||||
// API ready
|
// API ready
|
||||||
ready: function ready() {
|
ready: function ready() {
|
||||||
var player = this; // Ignore already setup (race condition)
|
var player = this;
|
||||||
|
var config = player.config.youtube; // Ignore already setup (race condition)
|
||||||
|
|
||||||
var currentId = player.media && player.media.getAttribute('id');
|
var currentId = player.media && player.media.getAttribute('id');
|
||||||
|
|
||||||
@ -12542,53 +12601,53 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
|
|
||||||
var videoId = parseId$1(source);
|
var videoId = parseId$1(source);
|
||||||
var id = generateId(player.provider); // Get poster, if already set
|
var id = generateId(player.provider); // Replace media element
|
||||||
|
|
||||||
var poster = player.poster; // Replace media element
|
|
||||||
|
|
||||||
var container = createElement('div', {
|
var container = createElement('div', {
|
||||||
id: id,
|
id: id,
|
||||||
'data-poster': poster
|
'data-poster': config.customControls ? player.poster : undefined
|
||||||
});
|
});
|
||||||
player.media = replaceElement(container, player.media); // Id to poster wrapper
|
player.media = replaceElement(container, player.media); // Only load the poster when using custom controls
|
||||||
|
|
||||||
var posterSrc = function posterSrc(s) {
|
if (config.customControls) {
|
||||||
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
var posterSrc = function posterSrc(s) {
|
||||||
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
||||||
|
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
||||||
|
|
||||||
|
|
||||||
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('sd'), 121);
|
return loadImage(posterSrc('sd'), 121);
|
||||||
}) // 480p padded 4:3
|
}) // 480p padded 4:3
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('hq'));
|
return loadImage(posterSrc('hq'));
|
||||||
}) // 360p padded 4:3. Always exists
|
}) // 360p padded 4:3. Always exists
|
||||||
.then(function (image) {
|
.then(function (image) {
|
||||||
return ui.setPoster.call(player, image.src);
|
return ui.setPoster.call(player, image.src);
|
||||||
}).then(function (src) {
|
}).then(function (src) {
|
||||||
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
||||||
if (!src.includes('maxres')) {
|
if (!src.includes('maxres')) {
|
||||||
player.elements.poster.style.backgroundSize = 'cover';
|
player.elements.poster.style.backgroundSize = 'cover';
|
||||||
}
|
}
|
||||||
}).catch(function () {});
|
}).catch(function () {});
|
||||||
var config = player.config.youtube; // Setup instance
|
} // Setup instance
|
||||||
// https://developers.google.com/youtube/iframe_api_reference
|
// https://developers.google.com/youtube/iframe_api_reference
|
||||||
|
|
||||||
player.embed = new window.YT.Player(id, {
|
|
||||||
|
player.embed = new window.YT.Player(player.media, {
|
||||||
videoId: videoId,
|
videoId: videoId,
|
||||||
host: getHost$1(config),
|
host: getHost$1(config),
|
||||||
playerVars: extend({}, {
|
playerVars: extend({}, {
|
||||||
autoplay: player.config.autoplay ? 1 : 0,
|
|
||||||
// Autoplay
|
// Autoplay
|
||||||
hl: player.config.hl,
|
autoplay: player.config.autoplay ? 1 : 0,
|
||||||
// iframe interface language
|
// iframe interface language
|
||||||
controls: player.supported.ui ? 0 : 1,
|
hl: player.config.hl,
|
||||||
// Only show controls if not fully supported
|
// Only show controls if not fully supported or opted out
|
||||||
disablekb: 1,
|
controls: player.supported.ui && config.customControls ? 0 : 1,
|
||||||
// Disable keyboard as we handle it
|
// Disable keyboard as we handle it
|
||||||
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
disablekb: 1,
|
||||||
// Allow iOS inline playback
|
// Allow iOS inline playback
|
||||||
|
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
||||||
// Captions are flaky on YouTube
|
// Captions are flaky on YouTube
|
||||||
cc_load_policy: player.captions.active ? 1 : 0,
|
cc_load_policy: player.captions.active ? 1 : 0,
|
||||||
cc_lang_pref: player.config.captions.language,
|
cc_lang_pref: player.config.captions.language,
|
||||||
@ -12699,6 +12758,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
var toggle = is$1.boolean(input) ? input : muted;
|
var toggle = is$1.boolean(input) ? input : muted;
|
||||||
muted = toggle;
|
muted = toggle;
|
||||||
instance[toggle ? 'mute' : 'unMute']();
|
instance[toggle ? 'mute' : 'unMute']();
|
||||||
|
instance.setVolume(volume * 100);
|
||||||
triggerEvent.call(player, player.media, 'volumechange');
|
triggerEvent.call(player, player.media, 'volumechange');
|
||||||
}
|
}
|
||||||
}); // Source
|
}); // Source
|
||||||
@ -12721,7 +12781,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
return player.config.speed.options.includes(s);
|
return player.config.speed.options.includes(s);
|
||||||
}); // Set the tabindex to avoid focus entering iframe
|
}); // Set the tabindex to avoid focus entering iframe
|
||||||
|
|
||||||
if (player.supported.ui) {
|
if (player.supported.ui && config.customControls) {
|
||||||
player.media.setAttribute('tabindex', -1);
|
player.media.setAttribute('tabindex', -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12748,9 +12808,11 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
}
|
}
|
||||||
}, 200); // Rebuild UI
|
}, 200); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 50);
|
return ui.build.call(player);
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onStateChange: function onStateChange(event) {
|
onStateChange: function onStateChange(event) {
|
||||||
// Get the instance
|
// Get the instance
|
||||||
@ -12796,7 +12858,7 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
||||||
if (!player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
if (config.customControls && !player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
||||||
player.media.pause();
|
player.media.pause();
|
||||||
} else {
|
} else {
|
||||||
assurePlaybackState$1.call(player, true);
|
assurePlaybackState$1.call(player, true);
|
||||||
@ -12869,7 +12931,8 @@ typeof navigator === "object" && (function (global, factory) {
|
|||||||
wrap$1(this.media, this.elements.wrapper); // Poster image container
|
wrap$1(this.media, this.elements.wrapper); // Poster image container
|
||||||
|
|
||||||
this.elements.poster = createElement('div', {
|
this.elements.poster = createElement('div', {
|
||||||
class: this.config.classNames.poster
|
class: this.config.classNames.poster,
|
||||||
|
hidden: ''
|
||||||
});
|
});
|
||||||
this.elements.wrapper.appendChild(this.elements.poster);
|
this.elements.wrapper.appendChild(this.elements.poster);
|
||||||
}
|
}
|
||||||
|
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
347
dist/plyr.polyfilled.mjs
vendored
347
dist/plyr.polyfilled.mjs
vendored
@ -68,7 +68,7 @@ var global_1 =
|
|||||||
check(typeof self == 'object' && self) ||
|
check(typeof self == 'object' && self) ||
|
||||||
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
||||||
// eslint-disable-next-line no-new-func
|
// eslint-disable-next-line no-new-func
|
||||||
Function('return this')();
|
(function () { return this; })() || Function('return this')();
|
||||||
|
|
||||||
var fails = function (exec) {
|
var fails = function (exec) {
|
||||||
try {
|
try {
|
||||||
@ -263,7 +263,7 @@ var shared = createCommonjsModule(function (module) {
|
|||||||
(module.exports = function (key, value) {
|
(module.exports = function (key, value) {
|
||||||
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
||||||
})('versions', []).push({
|
})('versions', []).push({
|
||||||
version: '3.6.5',
|
version: '3.7.0',
|
||||||
mode: 'global',
|
mode: 'global',
|
||||||
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
|
||||||
});
|
});
|
||||||
@ -301,11 +301,12 @@ var getterFor = function (TYPE) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (nativeWeakMap) {
|
if (nativeWeakMap) {
|
||||||
var store$1 = new WeakMap$2();
|
var store$1 = sharedStore.state || (sharedStore.state = new WeakMap$2());
|
||||||
var wmget = store$1.get;
|
var wmget = store$1.get;
|
||||||
var wmhas = store$1.has;
|
var wmhas = store$1.has;
|
||||||
var wmset = store$1.set;
|
var wmset = store$1.set;
|
||||||
set = function (it, metadata) {
|
set = function (it, metadata) {
|
||||||
|
metadata.facade = it;
|
||||||
wmset.call(store$1, it, metadata);
|
wmset.call(store$1, it, metadata);
|
||||||
return metadata;
|
return metadata;
|
||||||
};
|
};
|
||||||
@ -319,6 +320,7 @@ if (nativeWeakMap) {
|
|||||||
var STATE = sharedKey('state');
|
var STATE = sharedKey('state');
|
||||||
hiddenKeys[STATE] = true;
|
hiddenKeys[STATE] = true;
|
||||||
set = function (it, metadata) {
|
set = function (it, metadata) {
|
||||||
|
metadata.facade = it;
|
||||||
createNonEnumerableProperty(it, STATE, metadata);
|
createNonEnumerableProperty(it, STATE, metadata);
|
||||||
return metadata;
|
return metadata;
|
||||||
};
|
};
|
||||||
@ -347,9 +349,15 @@ var TEMPLATE = String(String).split('String');
|
|||||||
var unsafe = options ? !!options.unsafe : false;
|
var unsafe = options ? !!options.unsafe : false;
|
||||||
var simple = options ? !!options.enumerable : false;
|
var simple = options ? !!options.enumerable : false;
|
||||||
var noTargetGet = options ? !!options.noTargetGet : false;
|
var noTargetGet = options ? !!options.noTargetGet : false;
|
||||||
|
var state;
|
||||||
if (typeof value == 'function') {
|
if (typeof value == 'function') {
|
||||||
if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key);
|
if (typeof key == 'string' && !has(value, 'name')) {
|
||||||
enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
createNonEnumerableProperty(value, 'name', key);
|
||||||
|
}
|
||||||
|
state = enforceInternalState(value);
|
||||||
|
if (!state.source) {
|
||||||
|
state.source = TEMPLATE.join(typeof key == 'string' ? key : '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (O === global_1) {
|
if (O === global_1) {
|
||||||
if (simple) O[key] = value;
|
if (simple) O[key] = value;
|
||||||
@ -2435,14 +2443,20 @@ var objectAssign = !nativeAssign || fails(function () {
|
|||||||
} return T;
|
} return T;
|
||||||
} : nativeAssign;
|
} : nativeAssign;
|
||||||
|
|
||||||
|
var iteratorClose = function (iterator) {
|
||||||
|
var returnMethod = iterator['return'];
|
||||||
|
if (returnMethod !== undefined) {
|
||||||
|
return anObject(returnMethod.call(iterator)).value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// call something on iterator step with safe closing on error
|
// call something on iterator step with safe closing on error
|
||||||
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
var callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
|
||||||
try {
|
try {
|
||||||
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
||||||
// 7.4.6 IteratorClose(iterator, completion)
|
// 7.4.6 IteratorClose(iterator, completion)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
var returnMethod = iterator['return'];
|
iteratorClose(iterator);
|
||||||
if (returnMethod !== undefined) anObject(returnMethod.call(iterator));
|
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -2839,7 +2853,7 @@ var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
|
|||||||
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
|
||||||
|
|
||||||
redefineAll(URLSearchParamsPrototype, {
|
redefineAll(URLSearchParamsPrototype, {
|
||||||
// `URLSearchParams.prototype.appent` method
|
// `URLSearchParams.prototype.append` method
|
||||||
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
|
||||||
append: function append(name, value) {
|
append: function append(name, value) {
|
||||||
validateArgumentsLength(arguments.length, 2);
|
validateArgumentsLength(arguments.length, 2);
|
||||||
@ -4500,12 +4514,14 @@ function _nonIterableRest() {
|
|||||||
var _URL = global.URL;
|
var _URL = global.URL;
|
||||||
|
|
||||||
var URL = function URL(url, base) {
|
var URL = function URL(url, base) {
|
||||||
if (typeof url !== 'string') url = String(url); // Only create another document if the base is different from current location.
|
if (typeof url !== 'string') url = String(url);
|
||||||
|
if (base && typeof base !== 'string') base = String(base); // Only create another document if the base is different from current location.
|
||||||
|
|
||||||
var doc = document,
|
var doc = document,
|
||||||
baseElement;
|
baseElement;
|
||||||
|
|
||||||
if (base && (global.location === void 0 || base !== global.location.href)) {
|
if (base && (global.location === void 0 || base !== global.location.href)) {
|
||||||
|
base = base.toLowerCase();
|
||||||
doc = document.implementation.createHTMLDocument('');
|
doc = document.implementation.createHTMLDocument('');
|
||||||
baseElement = doc.createElement('base');
|
baseElement = doc.createElement('base');
|
||||||
baseElement.href = base;
|
baseElement.href = base;
|
||||||
@ -5011,11 +5027,11 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
|
|||||||
var regexp = /./;
|
var regexp = /./;
|
||||||
try {
|
try {
|
||||||
'/./'[METHOD_NAME](regexp);
|
'/./'[METHOD_NAME](regexp);
|
||||||
} catch (e) {
|
} catch (error1) {
|
||||||
try {
|
try {
|
||||||
regexp[MATCH$1] = false;
|
regexp[MATCH$1] = false;
|
||||||
return '/./'[METHOD_NAME](regexp);
|
return '/./'[METHOD_NAME](regexp);
|
||||||
} catch (f) { /* empty */ }
|
} catch (error2) { /* empty */ }
|
||||||
} return false;
|
} return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -5097,16 +5113,31 @@ var internalMetadata_2 = internalMetadata.fastKey;
|
|||||||
var internalMetadata_3 = internalMetadata.getWeakData;
|
var internalMetadata_3 = internalMetadata.getWeakData;
|
||||||
var internalMetadata_4 = internalMetadata.onFreeze;
|
var internalMetadata_4 = internalMetadata.onFreeze;
|
||||||
|
|
||||||
var iterate_1 = createCommonjsModule(function (module) {
|
|
||||||
var Result = function (stopped, result) {
|
var Result = function (stopped, result) {
|
||||||
this.stopped = stopped;
|
this.stopped = stopped;
|
||||||
this.result = result;
|
this.result = result;
|
||||||
};
|
};
|
||||||
|
|
||||||
var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITERATOR) {
|
var iterate = function (iterable, unboundFunction, options) {
|
||||||
var boundFunction = functionBindContext(fn, that, AS_ENTRIES ? 2 : 1);
|
var that = options && options.that;
|
||||||
|
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
||||||
|
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
||||||
|
var INTERRUPTED = !!(options && options.INTERRUPTED);
|
||||||
|
var fn = functionBindContext(unboundFunction, that, 1 + AS_ENTRIES + INTERRUPTED);
|
||||||
var iterator, iterFn, index, length, result, next, step;
|
var iterator, iterFn, index, length, result, next, step;
|
||||||
|
|
||||||
|
var stop = function (condition) {
|
||||||
|
if (iterator) iteratorClose(iterator);
|
||||||
|
return new Result(true, condition);
|
||||||
|
};
|
||||||
|
|
||||||
|
var callFn = function (value) {
|
||||||
|
if (AS_ENTRIES) {
|
||||||
|
anObject(value);
|
||||||
|
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
||||||
|
} return INTERRUPTED ? fn(value, stop) : fn(value);
|
||||||
|
};
|
||||||
|
|
||||||
if (IS_ITERATOR) {
|
if (IS_ITERATOR) {
|
||||||
iterator = iterable;
|
iterator = iterable;
|
||||||
} else {
|
} else {
|
||||||
@ -5115,9 +5146,7 @@ var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITER
|
|||||||
// optimisation for array iterators
|
// optimisation for array iterators
|
||||||
if (isArrayIteratorMethod(iterFn)) {
|
if (isArrayIteratorMethod(iterFn)) {
|
||||||
for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
for (index = 0, length = toLength(iterable.length); length > index; index++) {
|
||||||
result = AS_ENTRIES
|
result = callFn(iterable[index]);
|
||||||
? boundFunction(anObject(step = iterable[index])[0], step[1])
|
|
||||||
: boundFunction(iterable[index]);
|
|
||||||
if (result && result instanceof Result) return result;
|
if (result && result instanceof Result) return result;
|
||||||
} return new Result(false);
|
} return new Result(false);
|
||||||
}
|
}
|
||||||
@ -5126,16 +5155,16 @@ var iterate = module.exports = function (iterable, fn, that, AS_ENTRIES, IS_ITER
|
|||||||
|
|
||||||
next = iterator.next;
|
next = iterator.next;
|
||||||
while (!(step = next.call(iterator)).done) {
|
while (!(step = next.call(iterator)).done) {
|
||||||
result = callWithSafeIterationClosing(iterator, boundFunction, step.value, AS_ENTRIES);
|
try {
|
||||||
|
result = callFn(step.value);
|
||||||
|
} catch (error) {
|
||||||
|
iteratorClose(iterator);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
if (typeof result == 'object' && result && result instanceof Result) return result;
|
if (typeof result == 'object' && result && result instanceof Result) return result;
|
||||||
} return new Result(false);
|
} return new Result(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
iterate.stop = function (result) {
|
|
||||||
return new Result(true, result);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
||||||
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
||||||
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
||||||
@ -5193,7 +5222,7 @@ var collection = function (CONSTRUCTOR_NAME, wrapper, common) {
|
|||||||
Constructor = wrapper(function (dummy, iterable) {
|
Constructor = wrapper(function (dummy, iterable) {
|
||||||
anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
anInstance(dummy, Constructor, CONSTRUCTOR_NAME);
|
||||||
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
|
||||||
if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
||||||
return that;
|
return that;
|
||||||
});
|
});
|
||||||
Constructor.prototype = NativePrototype;
|
Constructor.prototype = NativePrototype;
|
||||||
@ -5283,7 +5312,7 @@ var collectionWeak = {
|
|||||||
id: id$1++,
|
id: id$1++,
|
||||||
frozen: undefined
|
frozen: undefined
|
||||||
});
|
});
|
||||||
if (iterable != undefined) iterate_1(iterable, that[ADDER], that, IS_MAP);
|
if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
||||||
});
|
});
|
||||||
|
|
||||||
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
||||||
@ -5972,6 +6001,8 @@ var setSpecies = function (CONSTRUCTOR_NAME) {
|
|||||||
|
|
||||||
var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
|
var engineIsIos = /(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent);
|
||||||
|
|
||||||
|
var engineIsNode = classofRaw(global_1.process) == 'process';
|
||||||
|
|
||||||
var location = global_1.location;
|
var location = global_1.location;
|
||||||
var set$1 = global_1.setImmediate;
|
var set$1 = global_1.setImmediate;
|
||||||
var clear = global_1.clearImmediate;
|
var clear = global_1.clearImmediate;
|
||||||
@ -6024,7 +6055,7 @@ if (!set$1 || !clear) {
|
|||||||
delete queue[id];
|
delete queue[id];
|
||||||
};
|
};
|
||||||
// Node.js 0.8-
|
// Node.js 0.8-
|
||||||
if (classofRaw(process$1) == 'process') {
|
if (engineIsNode) {
|
||||||
defer = function (id) {
|
defer = function (id) {
|
||||||
process$1.nextTick(runner(id));
|
process$1.nextTick(runner(id));
|
||||||
};
|
};
|
||||||
@ -6046,8 +6077,8 @@ if (!set$1 || !clear) {
|
|||||||
global_1.addEventListener &&
|
global_1.addEventListener &&
|
||||||
typeof postMessage == 'function' &&
|
typeof postMessage == 'function' &&
|
||||||
!global_1.importScripts &&
|
!global_1.importScripts &&
|
||||||
!fails(post) &&
|
location && location.protocol !== 'file:' &&
|
||||||
location.protocol !== 'file:'
|
!fails(post)
|
||||||
) {
|
) {
|
||||||
defer = post;
|
defer = post;
|
||||||
global_1.addEventListener('message', listener, false);
|
global_1.addEventListener('message', listener, false);
|
||||||
@ -6073,14 +6104,14 @@ var task = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
var getOwnPropertyDescriptor$3 = objectGetOwnPropertyDescriptor.f;
|
||||||
|
|
||||||
var macrotask = task.set;
|
var macrotask = task.set;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var MutationObserver$1 = global_1.MutationObserver || global_1.WebKitMutationObserver;
|
var MutationObserver$1 = global_1.MutationObserver || global_1.WebKitMutationObserver;
|
||||||
|
var document$2 = global_1.document;
|
||||||
var process$2 = global_1.process;
|
var process$2 = global_1.process;
|
||||||
var Promise$1 = global_1.Promise;
|
var Promise$1 = global_1.Promise;
|
||||||
var IS_NODE = classofRaw(process$2) == 'process';
|
|
||||||
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
// Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
||||||
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global_1, 'queueMicrotask');
|
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$3(global_1, 'queueMicrotask');
|
||||||
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
||||||
@ -6091,7 +6122,7 @@ var flush, head, last, notify, toggle, node, promise, then;
|
|||||||
if (!queueMicrotask) {
|
if (!queueMicrotask) {
|
||||||
flush = function () {
|
flush = function () {
|
||||||
var parent, fn;
|
var parent, fn;
|
||||||
if (IS_NODE && (parent = process$2.domain)) parent.exit();
|
if (engineIsNode && (parent = process$2.domain)) parent.exit();
|
||||||
while (head) {
|
while (head) {
|
||||||
fn = head.fn;
|
fn = head.fn;
|
||||||
head = head.next;
|
head = head.next;
|
||||||
@ -6106,15 +6137,10 @@ if (!queueMicrotask) {
|
|||||||
if (parent) parent.enter();
|
if (parent) parent.enter();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Node.js
|
|
||||||
if (IS_NODE) {
|
|
||||||
notify = function () {
|
|
||||||
process$2.nextTick(flush);
|
|
||||||
};
|
|
||||||
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
|
||||||
} else if (MutationObserver$1 && !engineIsIos) {
|
if (!engineIsIos && !engineIsNode && MutationObserver$1 && document$2) {
|
||||||
toggle = true;
|
toggle = true;
|
||||||
node = document.createTextNode('');
|
node = document$2.createTextNode('');
|
||||||
new MutationObserver$1(flush).observe(node, { characterData: true });
|
new MutationObserver$1(flush).observe(node, { characterData: true });
|
||||||
notify = function () {
|
notify = function () {
|
||||||
node.data = toggle = !toggle;
|
node.data = toggle = !toggle;
|
||||||
@ -6127,6 +6153,11 @@ if (!queueMicrotask) {
|
|||||||
notify = function () {
|
notify = function () {
|
||||||
then.call(promise, flush);
|
then.call(promise, flush);
|
||||||
};
|
};
|
||||||
|
// Node.js without promises
|
||||||
|
} else if (engineIsNode) {
|
||||||
|
notify = function () {
|
||||||
|
process$2.nextTick(flush);
|
||||||
|
};
|
||||||
// for other environments - macrotask based on:
|
// for other environments - macrotask based on:
|
||||||
// - setImmediate
|
// - setImmediate
|
||||||
// - MessageChannel
|
// - MessageChannel
|
||||||
@ -6205,6 +6236,7 @@ var task$1 = task.set;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var SPECIES$6 = wellKnownSymbol('species');
|
var SPECIES$6 = wellKnownSymbol('species');
|
||||||
var PROMISE = 'Promise';
|
var PROMISE = 'Promise';
|
||||||
var getInternalState$3 = internalState.get;
|
var getInternalState$3 = internalState.get;
|
||||||
@ -6212,13 +6244,13 @@ var setInternalState$6 = internalState.set;
|
|||||||
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
var getInternalPromiseState = internalState.getterFor(PROMISE);
|
||||||
var PromiseConstructor = nativePromiseConstructor;
|
var PromiseConstructor = nativePromiseConstructor;
|
||||||
var TypeError$1 = global_1.TypeError;
|
var TypeError$1 = global_1.TypeError;
|
||||||
var document$2 = global_1.document;
|
var document$3 = global_1.document;
|
||||||
var process$3 = global_1.process;
|
var process$3 = global_1.process;
|
||||||
var $fetch$1 = getBuiltIn('fetch');
|
var $fetch$1 = getBuiltIn('fetch');
|
||||||
var newPromiseCapability$1 = newPromiseCapability.f;
|
var newPromiseCapability$1 = newPromiseCapability.f;
|
||||||
var newGenericPromiseCapability = newPromiseCapability$1;
|
var newGenericPromiseCapability = newPromiseCapability$1;
|
||||||
var IS_NODE$1 = classofRaw(process$3) == 'process';
|
var DISPATCH_EVENT = !!(document$3 && document$3.createEvent && global_1.dispatchEvent);
|
||||||
var DISPATCH_EVENT = !!(document$2 && document$2.createEvent && global_1.dispatchEvent);
|
var NATIVE_REJECTION_EVENT = typeof PromiseRejectionEvent == 'function';
|
||||||
var UNHANDLED_REJECTION = 'unhandledrejection';
|
var UNHANDLED_REJECTION = 'unhandledrejection';
|
||||||
var REJECTION_HANDLED = 'rejectionhandled';
|
var REJECTION_HANDLED = 'rejectionhandled';
|
||||||
var PENDING = 0;
|
var PENDING = 0;
|
||||||
@ -6236,7 +6268,7 @@ var FORCED$3 = isForced_1(PROMISE, function () {
|
|||||||
// We can't detect it synchronously, so just check versions
|
// We can't detect it synchronously, so just check versions
|
||||||
if (engineV8Version === 66) return true;
|
if (engineV8Version === 66) return true;
|
||||||
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
|
||||||
if (!IS_NODE$1 && typeof PromiseRejectionEvent != 'function') return true;
|
if (!engineIsNode && !NATIVE_REJECTION_EVENT) return true;
|
||||||
}
|
}
|
||||||
// We can't use @@species feature detection in V8 since it causes
|
// We can't use @@species feature detection in V8 since it causes
|
||||||
// deoptimization and performance degradation
|
// deoptimization and performance degradation
|
||||||
@ -6262,7 +6294,7 @@ var isThenable = function (it) {
|
|||||||
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
|
||||||
};
|
};
|
||||||
|
|
||||||
var notify$1 = function (promise, state, isReject) {
|
var notify$1 = function (state, isReject) {
|
||||||
if (state.notified) return;
|
if (state.notified) return;
|
||||||
state.notified = true;
|
state.notified = true;
|
||||||
var chain = state.reactions;
|
var chain = state.reactions;
|
||||||
@ -6281,7 +6313,7 @@ var notify$1 = function (promise, state, isReject) {
|
|||||||
try {
|
try {
|
||||||
if (handler) {
|
if (handler) {
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
if (state.rejection === UNHANDLED) onHandleUnhandled(promise, state);
|
if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
||||||
state.rejection = HANDLED;
|
state.rejection = HANDLED;
|
||||||
}
|
}
|
||||||
if (handler === true) result = value;
|
if (handler === true) result = value;
|
||||||
@ -6306,36 +6338,37 @@ var notify$1 = function (promise, state, isReject) {
|
|||||||
}
|
}
|
||||||
state.reactions = [];
|
state.reactions = [];
|
||||||
state.notified = false;
|
state.notified = false;
|
||||||
if (isReject && !state.rejection) onUnhandled(promise, state);
|
if (isReject && !state.rejection) onUnhandled(state);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var dispatchEvent = function (name, promise, reason) {
|
var dispatchEvent = function (name, promise, reason) {
|
||||||
var event, handler;
|
var event, handler;
|
||||||
if (DISPATCH_EVENT) {
|
if (DISPATCH_EVENT) {
|
||||||
event = document$2.createEvent('Event');
|
event = document$3.createEvent('Event');
|
||||||
event.promise = promise;
|
event.promise = promise;
|
||||||
event.reason = reason;
|
event.reason = reason;
|
||||||
event.initEvent(name, false, true);
|
event.initEvent(name, false, true);
|
||||||
global_1.dispatchEvent(event);
|
global_1.dispatchEvent(event);
|
||||||
} else event = { promise: promise, reason: reason };
|
} else event = { promise: promise, reason: reason };
|
||||||
if (handler = global_1['on' + name]) handler(event);
|
if (!NATIVE_REJECTION_EVENT && (handler = global_1['on' + name])) handler(event);
|
||||||
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onUnhandled = function (promise, state) {
|
var onUnhandled = function (state) {
|
||||||
task$1.call(global_1, function () {
|
task$1.call(global_1, function () {
|
||||||
|
var promise = state.facade;
|
||||||
var value = state.value;
|
var value = state.value;
|
||||||
var IS_UNHANDLED = isUnhandled(state);
|
var IS_UNHANDLED = isUnhandled(state);
|
||||||
var result;
|
var result;
|
||||||
if (IS_UNHANDLED) {
|
if (IS_UNHANDLED) {
|
||||||
result = perform(function () {
|
result = perform(function () {
|
||||||
if (IS_NODE$1) {
|
if (engineIsNode) {
|
||||||
process$3.emit('unhandledRejection', value, promise);
|
process$3.emit('unhandledRejection', value, promise);
|
||||||
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
} else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
||||||
});
|
});
|
||||||
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
// Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
|
||||||
state.rejection = IS_NODE$1 || isUnhandled(state) ? UNHANDLED : HANDLED;
|
state.rejection = engineIsNode || isUnhandled(state) ? UNHANDLED : HANDLED;
|
||||||
if (result.error) throw result.value;
|
if (result.error) throw result.value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -6345,55 +6378,56 @@ var isUnhandled = function (state) {
|
|||||||
return state.rejection !== HANDLED && !state.parent;
|
return state.rejection !== HANDLED && !state.parent;
|
||||||
};
|
};
|
||||||
|
|
||||||
var onHandleUnhandled = function (promise, state) {
|
var onHandleUnhandled = function (state) {
|
||||||
task$1.call(global_1, function () {
|
task$1.call(global_1, function () {
|
||||||
if (IS_NODE$1) {
|
var promise = state.facade;
|
||||||
|
if (engineIsNode) {
|
||||||
process$3.emit('rejectionHandled', promise);
|
process$3.emit('rejectionHandled', promise);
|
||||||
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
} else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var bind = function (fn, promise, state, unwrap) {
|
var bind = function (fn, state, unwrap) {
|
||||||
return function (value) {
|
return function (value) {
|
||||||
fn(promise, state, value, unwrap);
|
fn(state, value, unwrap);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var internalReject = function (promise, state, value, unwrap) {
|
var internalReject = function (state, value, unwrap) {
|
||||||
if (state.done) return;
|
if (state.done) return;
|
||||||
state.done = true;
|
state.done = true;
|
||||||
if (unwrap) state = unwrap;
|
if (unwrap) state = unwrap;
|
||||||
state.value = value;
|
state.value = value;
|
||||||
state.state = REJECTED;
|
state.state = REJECTED;
|
||||||
notify$1(promise, state, true);
|
notify$1(state, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
var internalResolve = function (promise, state, value, unwrap) {
|
var internalResolve = function (state, value, unwrap) {
|
||||||
if (state.done) return;
|
if (state.done) return;
|
||||||
state.done = true;
|
state.done = true;
|
||||||
if (unwrap) state = unwrap;
|
if (unwrap) state = unwrap;
|
||||||
try {
|
try {
|
||||||
if (promise === value) throw TypeError$1("Promise can't be resolved itself");
|
if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
|
||||||
var then = isThenable(value);
|
var then = isThenable(value);
|
||||||
if (then) {
|
if (then) {
|
||||||
microtask(function () {
|
microtask(function () {
|
||||||
var wrapper = { done: false };
|
var wrapper = { done: false };
|
||||||
try {
|
try {
|
||||||
then.call(value,
|
then.call(value,
|
||||||
bind(internalResolve, promise, wrapper, state),
|
bind(internalResolve, wrapper, state),
|
||||||
bind(internalReject, promise, wrapper, state)
|
bind(internalReject, wrapper, state)
|
||||||
);
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
internalReject(promise, wrapper, error, state);
|
internalReject(wrapper, error, state);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
state.value = value;
|
state.value = value;
|
||||||
state.state = FULFILLED;
|
state.state = FULFILLED;
|
||||||
notify$1(promise, state, false);
|
notify$1(state, false);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
internalReject(promise, { done: false }, error, state);
|
internalReject({ done: false }, error, state);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6406,9 +6440,9 @@ if (FORCED$3) {
|
|||||||
Internal.call(this);
|
Internal.call(this);
|
||||||
var state = getInternalState$3(this);
|
var state = getInternalState$3(this);
|
||||||
try {
|
try {
|
||||||
executor(bind(internalResolve, this, state), bind(internalReject, this, state));
|
executor(bind(internalResolve, state), bind(internalReject, state));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
internalReject(this, state, error);
|
internalReject(state, error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
@ -6432,10 +6466,10 @@ if (FORCED$3) {
|
|||||||
var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
|
var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
|
||||||
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
|
||||||
reaction.fail = typeof onRejected == 'function' && onRejected;
|
reaction.fail = typeof onRejected == 'function' && onRejected;
|
||||||
reaction.domain = IS_NODE$1 ? process$3.domain : undefined;
|
reaction.domain = engineIsNode ? process$3.domain : undefined;
|
||||||
state.parent = true;
|
state.parent = true;
|
||||||
state.reactions.push(reaction);
|
state.reactions.push(reaction);
|
||||||
if (state.state != PENDING) notify$1(this, state, false);
|
if (state.state != PENDING) notify$1(state, false);
|
||||||
return reaction.promise;
|
return reaction.promise;
|
||||||
},
|
},
|
||||||
// `Promise.prototype.catch` method
|
// `Promise.prototype.catch` method
|
||||||
@ -6448,8 +6482,8 @@ if (FORCED$3) {
|
|||||||
var promise = new Internal();
|
var promise = new Internal();
|
||||||
var state = getInternalState$3(promise);
|
var state = getInternalState$3(promise);
|
||||||
this.promise = promise;
|
this.promise = promise;
|
||||||
this.resolve = bind(internalResolve, promise, state);
|
this.resolve = bind(internalResolve, state);
|
||||||
this.reject = bind(internalReject, promise, state);
|
this.reject = bind(internalReject, state);
|
||||||
};
|
};
|
||||||
newPromiseCapability.f = newPromiseCapability$1 = function (C) {
|
newPromiseCapability.f = newPromiseCapability$1 = function (C) {
|
||||||
return C === PromiseConstructor || C === PromiseWrapper
|
return C === PromiseConstructor || C === PromiseWrapper
|
||||||
@ -6520,7 +6554,7 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
|
|||||||
var values = [];
|
var values = [];
|
||||||
var counter = 0;
|
var counter = 0;
|
||||||
var remaining = 1;
|
var remaining = 1;
|
||||||
iterate_1(iterable, function (promise) {
|
iterate(iterable, function (promise) {
|
||||||
var index = counter++;
|
var index = counter++;
|
||||||
var alreadyCalled = false;
|
var alreadyCalled = false;
|
||||||
values.push(undefined);
|
values.push(undefined);
|
||||||
@ -6545,7 +6579,7 @@ _export({ target: PROMISE, stat: true, forced: INCORRECT_ITERATION$1 }, {
|
|||||||
var reject = capability.reject;
|
var reject = capability.reject;
|
||||||
var result = perform(function () {
|
var result = perform(function () {
|
||||||
var $promiseResolve = aFunction$1(C.resolve);
|
var $promiseResolve = aFunction$1(C.resolve);
|
||||||
iterate_1(iterable, function (promise) {
|
iterate(iterable, function (promise) {
|
||||||
$promiseResolve.call(C, promise).then(capability.resolve, reject);
|
$promiseResolve.call(C, promise).then(capability.resolve, reject);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -6792,12 +6826,17 @@ var $reduce = arrayReduce.left;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var STRICT_METHOD$5 = arrayMethodIsStrict('reduce');
|
var STRICT_METHOD$5 = arrayMethodIsStrict('reduce');
|
||||||
var USES_TO_LENGTH$9 = arrayMethodUsesToLength('reduce', { 1: 0 });
|
var USES_TO_LENGTH$9 = arrayMethodUsesToLength('reduce', { 1: 0 });
|
||||||
|
// Chrome 80-82 has a critical bug
|
||||||
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
||||||
|
var CHROME_BUG = !engineIsNode && engineV8Version > 79 && engineV8Version < 83;
|
||||||
|
|
||||||
// `Array.prototype.reduce` method
|
// `Array.prototype.reduce` method
|
||||||
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
|
||||||
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$9 }, {
|
_export({ target: 'Array', proto: true, forced: !STRICT_METHOD$5 || !USES_TO_LENGTH$9 || CHROME_BUG }, {
|
||||||
reduce: function reduce(callbackfn /* , initialValue */) {
|
reduce: function reduce(callbackfn /* , initialValue */) {
|
||||||
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);
|
||||||
}
|
}
|
||||||
@ -9978,7 +10017,7 @@ var defaults$1 = {
|
|||||||
// Sprite (for icons)
|
// Sprite (for icons)
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/3.6.2/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/3.6.3/plyr.svg',
|
||||||
// Blank video (used to prevent errors on source change)
|
// Blank video (used to prevent errors on source change)
|
||||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||||
// Quality default
|
// Quality default
|
||||||
@ -10096,7 +10135,7 @@ var defaults$1 = {
|
|||||||
vimeo: {
|
vimeo: {
|
||||||
sdk: 'https://player.vimeo.com/api/player.js',
|
sdk: 'https://player.vimeo.com/api/player.js',
|
||||||
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
iframe: 'https://player.vimeo.com/video/{0}?{1}',
|
||||||
api: 'https://vimeo.com/api/v2/video/{0}.json'
|
api: 'https://vimeo.com/api/oembed.json?url={0}'
|
||||||
},
|
},
|
||||||
youtube: {
|
youtube: {
|
||||||
sdk: 'https://www.youtube.com/iframe_api',
|
sdk: 'https://www.youtube.com/iframe_api',
|
||||||
@ -10266,24 +10305,27 @@ var defaults$1 = {
|
|||||||
title: false,
|
title: false,
|
||||||
speed: true,
|
speed: true,
|
||||||
transparent: false,
|
transparent: false,
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
referrerPolicy: null,
|
||||||
|
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
||||||
// Whether the owner of the video has a Pro or Business account
|
// Whether the owner of the video has a Pro or Business account
|
||||||
// (which allows us to properly hide controls without CSS hacks, etc)
|
// (which allows us to properly hide controls without CSS hacks, etc)
|
||||||
premium: false,
|
premium: false
|
||||||
// Custom settings from Plyr
|
|
||||||
referrerPolicy: null // https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// YouTube plugin
|
// YouTube plugin
|
||||||
youtube: {
|
youtube: {
|
||||||
noCookie: true,
|
|
||||||
// Whether to use an alternative version of YouTube without cookies
|
|
||||||
rel: 0,
|
rel: 0,
|
||||||
// No related vids
|
// No related vids
|
||||||
showinfo: 0,
|
showinfo: 0,
|
||||||
// Hide info
|
// Hide info
|
||||||
iv_load_policy: 3,
|
iv_load_policy: 3,
|
||||||
// Hide annotations
|
// Hide annotations
|
||||||
modestbranding: 1 // Hide logos as much as possible (they still show one in the corner when paused)
|
modestbranding: 1,
|
||||||
|
// Hide logos as much as possible (they still show one in the corner when paused)
|
||||||
|
// Custom settings from Plyr
|
||||||
|
customControls: true,
|
||||||
|
noCookie: false // Whether to use an alternative version of YouTube without cookies
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -10402,7 +10444,7 @@ var Fullscreen = /*#__PURE__*/function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_this.toggle();
|
_this.player.listeners.proxy(event, _this.toggle, 'fullscreen');
|
||||||
}); // Tap focus when in fullscreen
|
}); // Tap focus when in fullscreen
|
||||||
|
|
||||||
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
on.call(this, this.player.elements.container, 'keydown', function (event) {
|
||||||
@ -10825,7 +10867,9 @@ var ui = {
|
|||||||
} // Set property synchronously to respect the call order
|
} // Set property synchronously to respect the call order
|
||||||
|
|
||||||
|
|
||||||
this.media.setAttribute('data-poster', poster); // Wait until ui is ready
|
this.media.setAttribute('data-poster', poster); // Show the poster
|
||||||
|
|
||||||
|
this.elements.poster.removeAttribute('hidden'); // Wait until ui is ready
|
||||||
|
|
||||||
return ready.call(this) // Load image
|
return ready.call(this) // Load image
|
||||||
.then(function () {
|
.then(function () {
|
||||||
@ -11257,7 +11301,14 @@ var Listeners = /*#__PURE__*/function () {
|
|||||||
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
ratio = _setPlayerSize.ratio; // Set Vimeo gutter
|
||||||
|
|
||||||
|
|
||||||
setGutter(ratio, padding, isEnter); // If not using native browser fullscreen API, we need to check for resizes of viewport
|
setGutter(ratio, padding, isEnter); // Horrible hack for Safari 14 not repainting properly on entering fullscreen
|
||||||
|
|
||||||
|
if (isEnter) {
|
||||||
|
setTimeout(function () {
|
||||||
|
return repaint(elements.container);
|
||||||
|
}, 100);
|
||||||
|
} // If not using native browser fullscreen API, we need to check for resizes of viewport
|
||||||
|
|
||||||
|
|
||||||
if (!usingNative) {
|
if (!usingNative) {
|
||||||
if (isEnter) {
|
if (isEnter) {
|
||||||
@ -11448,9 +11499,17 @@ var Listeners = /*#__PURE__*/function () {
|
|||||||
|
|
||||||
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
this.bind(elements.buttons.restart, 'click', player.restart, 'restart'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.rewind, 'click', player.rewind, 'rewind'); // Rewind
|
this.bind(elements.buttons.rewind, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after rewind
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.rewind();
|
||||||
|
}, 'rewind'); // Rewind
|
||||||
|
|
||||||
this.bind(elements.buttons.fastForward, 'click', player.forward, 'fastForward'); // Mute toggle
|
this.bind(elements.buttons.fastForward, 'click', function () {
|
||||||
|
// Record seek time so we can prevent hiding controls for a few seconds after fast forward
|
||||||
|
player.lastSeekTime = Date.now();
|
||||||
|
player.forward();
|
||||||
|
}, 'fastForward'); // Mute toggle
|
||||||
|
|
||||||
this.bind(elements.buttons.mute, 'click', function () {
|
this.bind(elements.buttons.mute, 'click', function () {
|
||||||
player.muted = !player.muted;
|
player.muted = !player.muted;
|
||||||
@ -12158,35 +12217,32 @@ var vimeo = {
|
|||||||
} // Inject the package
|
} // Inject the package
|
||||||
|
|
||||||
|
|
||||||
var poster = player.poster;
|
if (premium || !config.customControls) {
|
||||||
|
iframe.setAttribute('data-poster', player.poster);
|
||||||
if (premium) {
|
|
||||||
iframe.setAttribute('data-poster', poster);
|
|
||||||
player.media = replaceElement(iframe, player.media);
|
player.media = replaceElement(iframe, player.media);
|
||||||
} else {
|
} else {
|
||||||
var wrapper = createElement('div', {
|
var wrapper = createElement('div', {
|
||||||
class: player.config.classNames.embedContainer,
|
class: player.config.classNames.embedContainer,
|
||||||
'data-poster': poster
|
'data-poster': player.poster
|
||||||
});
|
});
|
||||||
wrapper.appendChild(iframe);
|
wrapper.appendChild(iframe);
|
||||||
player.media = replaceElement(wrapper, player.media);
|
player.media = replaceElement(wrapper, player.media);
|
||||||
} // Get poster image
|
} // Get poster image
|
||||||
|
|
||||||
|
|
||||||
fetch(format(player.config.urls.vimeo.api, id), 'json').then(function (response) {
|
if (!config.customControls) {
|
||||||
if (is$1.empty(response)) {
|
fetch(format(player.config.urls.vimeo.api, src)).then(function (response) {
|
||||||
return;
|
if (is$1.empty(response) || !response.thumbnail_url) {
|
||||||
} // Get the URL for thumbnail
|
return;
|
||||||
|
} // Set and show poster
|
||||||
|
|
||||||
|
|
||||||
var url = new URL(response[0].thumbnail_large); // Get original image
|
ui.setPoster.call(player, response.thumbnail_url).catch(function () {});
|
||||||
|
});
|
||||||
url.pathname = "".concat(url.pathname.split('_')[0], ".jpg"); // Set and show poster
|
} // Setup instance
|
||||||
|
|
||||||
ui.setPoster.call(player, url.href).catch(function () {});
|
|
||||||
}); // Setup instance
|
|
||||||
// https://github.com/vimeo/player.js
|
// https://github.com/vimeo/player.js
|
||||||
|
|
||||||
|
|
||||||
player.embed = new window.Vimeo.Player(iframe, {
|
player.embed = new window.Vimeo.Player(iframe, {
|
||||||
autopause: player.config.autopause,
|
autopause: player.config.autopause,
|
||||||
muted: player.muted
|
muted: player.muted
|
||||||
@ -12426,9 +12482,11 @@ var vimeo = {
|
|||||||
triggerEvent.call(player, player.media, 'error');
|
triggerEvent.call(player, player.media, 'error');
|
||||||
}); // Rebuild UI
|
}); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 0);
|
return ui.build.call(player);
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -12519,7 +12577,8 @@ var youtube = {
|
|||||||
},
|
},
|
||||||
// API ready
|
// API ready
|
||||||
ready: function ready() {
|
ready: function ready() {
|
||||||
var player = this; // Ignore already setup (race condition)
|
var player = this;
|
||||||
|
var config = player.config.youtube; // Ignore already setup (race condition)
|
||||||
|
|
||||||
var currentId = player.media && player.media.getAttribute('id');
|
var currentId = player.media && player.media.getAttribute('id');
|
||||||
|
|
||||||
@ -12536,53 +12595,53 @@ var youtube = {
|
|||||||
|
|
||||||
|
|
||||||
var videoId = parseId$1(source);
|
var videoId = parseId$1(source);
|
||||||
var id = generateId(player.provider); // Get poster, if already set
|
var id = generateId(player.provider); // Replace media element
|
||||||
|
|
||||||
var poster = player.poster; // Replace media element
|
|
||||||
|
|
||||||
var container = createElement('div', {
|
var container = createElement('div', {
|
||||||
id: id,
|
id: id,
|
||||||
'data-poster': poster
|
'data-poster': config.customControls ? player.poster : undefined
|
||||||
});
|
});
|
||||||
player.media = replaceElement(container, player.media); // Id to poster wrapper
|
player.media = replaceElement(container, player.media); // Only load the poster when using custom controls
|
||||||
|
|
||||||
var posterSrc = function posterSrc(s) {
|
if (config.customControls) {
|
||||||
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
var posterSrc = function posterSrc(s) {
|
||||||
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
return "https://i.ytimg.com/vi/".concat(videoId, "/").concat(s, "default.jpg");
|
||||||
|
}; // Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
||||||
|
|
||||||
|
|
||||||
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
loadImage(posterSrc('maxres'), 121) // Higest quality and unpadded
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('sd'), 121);
|
return loadImage(posterSrc('sd'), 121);
|
||||||
}) // 480p padded 4:3
|
}) // 480p padded 4:3
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
return loadImage(posterSrc('hq'));
|
return loadImage(posterSrc('hq'));
|
||||||
}) // 360p padded 4:3. Always exists
|
}) // 360p padded 4:3. Always exists
|
||||||
.then(function (image) {
|
.then(function (image) {
|
||||||
return ui.setPoster.call(player, image.src);
|
return ui.setPoster.call(player, image.src);
|
||||||
}).then(function (src) {
|
}).then(function (src) {
|
||||||
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
// If the image is padded, use background-size "cover" instead (like youtube does too with their posters)
|
||||||
if (!src.includes('maxres')) {
|
if (!src.includes('maxres')) {
|
||||||
player.elements.poster.style.backgroundSize = 'cover';
|
player.elements.poster.style.backgroundSize = 'cover';
|
||||||
}
|
}
|
||||||
}).catch(function () {});
|
}).catch(function () {});
|
||||||
var config = player.config.youtube; // Setup instance
|
} // Setup instance
|
||||||
// https://developers.google.com/youtube/iframe_api_reference
|
// https://developers.google.com/youtube/iframe_api_reference
|
||||||
|
|
||||||
player.embed = new window.YT.Player(id, {
|
|
||||||
|
player.embed = new window.YT.Player(player.media, {
|
||||||
videoId: videoId,
|
videoId: videoId,
|
||||||
host: getHost$1(config),
|
host: getHost$1(config),
|
||||||
playerVars: extend({}, {
|
playerVars: extend({}, {
|
||||||
autoplay: player.config.autoplay ? 1 : 0,
|
|
||||||
// Autoplay
|
// Autoplay
|
||||||
hl: player.config.hl,
|
autoplay: player.config.autoplay ? 1 : 0,
|
||||||
// iframe interface language
|
// iframe interface language
|
||||||
controls: player.supported.ui ? 0 : 1,
|
hl: player.config.hl,
|
||||||
// Only show controls if not fully supported
|
// Only show controls if not fully supported or opted out
|
||||||
disablekb: 1,
|
controls: player.supported.ui && config.customControls ? 0 : 1,
|
||||||
// Disable keyboard as we handle it
|
// Disable keyboard as we handle it
|
||||||
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
disablekb: 1,
|
||||||
// Allow iOS inline playback
|
// Allow iOS inline playback
|
||||||
|
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
||||||
// Captions are flaky on YouTube
|
// Captions are flaky on YouTube
|
||||||
cc_load_policy: player.captions.active ? 1 : 0,
|
cc_load_policy: player.captions.active ? 1 : 0,
|
||||||
cc_lang_pref: player.config.captions.language,
|
cc_lang_pref: player.config.captions.language,
|
||||||
@ -12693,6 +12752,7 @@ var youtube = {
|
|||||||
var toggle = is$1.boolean(input) ? input : muted;
|
var toggle = is$1.boolean(input) ? input : muted;
|
||||||
muted = toggle;
|
muted = toggle;
|
||||||
instance[toggle ? 'mute' : 'unMute']();
|
instance[toggle ? 'mute' : 'unMute']();
|
||||||
|
instance.setVolume(volume * 100);
|
||||||
triggerEvent.call(player, player.media, 'volumechange');
|
triggerEvent.call(player, player.media, 'volumechange');
|
||||||
}
|
}
|
||||||
}); // Source
|
}); // Source
|
||||||
@ -12715,7 +12775,7 @@ var youtube = {
|
|||||||
return player.config.speed.options.includes(s);
|
return player.config.speed.options.includes(s);
|
||||||
}); // Set the tabindex to avoid focus entering iframe
|
}); // Set the tabindex to avoid focus entering iframe
|
||||||
|
|
||||||
if (player.supported.ui) {
|
if (player.supported.ui && config.customControls) {
|
||||||
player.media.setAttribute('tabindex', -1);
|
player.media.setAttribute('tabindex', -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12742,9 +12802,11 @@ var youtube = {
|
|||||||
}
|
}
|
||||||
}, 200); // Rebuild UI
|
}, 200); // Rebuild UI
|
||||||
|
|
||||||
setTimeout(function () {
|
if (config.customControls) {
|
||||||
return ui.build.call(player);
|
setTimeout(function () {
|
||||||
}, 50);
|
return ui.build.call(player);
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onStateChange: function onStateChange(event) {
|
onStateChange: function onStateChange(event) {
|
||||||
// Get the instance
|
// Get the instance
|
||||||
@ -12790,7 +12852,7 @@ var youtube = {
|
|||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
// Restore paused state (YouTube starts playing on seek if the video hasn't been played yet)
|
||||||
if (!player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
if (config.customControls && !player.config.autoplay && player.media.paused && !player.embed.hasPlayed) {
|
||||||
player.media.pause();
|
player.media.pause();
|
||||||
} else {
|
} else {
|
||||||
assurePlaybackState$1.call(player, true);
|
assurePlaybackState$1.call(player, true);
|
||||||
@ -12863,7 +12925,8 @@ var media = {
|
|||||||
wrap$1(this.media, this.elements.wrapper); // Poster image container
|
wrap$1(this.media, this.elements.wrapper); // Poster image container
|
||||||
|
|
||||||
this.elements.poster = createElement('div', {
|
this.elements.poster = createElement('div', {
|
||||||
class: this.config.classNames.poster
|
class: this.config.classNames.poster,
|
||||||
|
hidden: ''
|
||||||
});
|
});
|
||||||
this.elements.wrapper.appendChild(this.elements.poster);
|
this.elements.wrapper.appendChild(this.elements.poster);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plyr",
|
"name": "plyr",
|
||||||
"version": "3.6.2",
|
"version": "3.6.3",
|
||||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||||
"homepage": "https://plyr.io",
|
"homepage": "https://plyr.io",
|
||||||
"author": "Sam Potts <sam@potts.es>",
|
"author": "Sam Potts <sam@potts.es>",
|
||||||
|
@ -61,7 +61,7 @@ const defaults = {
|
|||||||
// Sprite (for icons)
|
// Sprite (for icons)
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/3.6.2/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/3.6.3/plyr.svg',
|
||||||
|
|
||||||
// Blank video (used to prevent errors on source change)
|
// Blank video (used to prevent errors on source change)
|
||||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr
|
// Plyr
|
||||||
// plyr.js v3.6.2
|
// plyr.js v3.6.3
|
||||||
// https://github.com/sampotts/plyr
|
// https://github.com/sampotts/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr Polyfilled Build
|
// Plyr Polyfilled Build
|
||||||
// plyr.js v3.6.2
|
// plyr.js v3.6.3
|
||||||
// https://github.com/sampotts/plyr
|
// https://github.com/sampotts/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user