@tabler/core 1.0.0-beta17 → 1.0.0-beta18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -7
- package/dist/.DS_Store +0 -0
- package/dist/css/demo.css +13 -43
- package/dist/css/demo.min.css +3 -3
- package/dist/css/demo.rtl.css +13 -43
- package/dist/css/demo.rtl.min.css +3 -3
- package/dist/css/tabler-flags.css +5 -3
- package/dist/css/tabler-flags.min.css +3 -3
- package/dist/css/tabler-flags.rtl.css +5 -3
- package/dist/css/tabler-flags.rtl.min.css +3 -3
- package/dist/css/tabler-payments.css +12 -2
- package/dist/css/tabler-payments.min.css +3 -3
- package/dist/css/tabler-payments.rtl.css +12 -2
- package/dist/css/tabler-payments.rtl.min.css +3 -3
- package/dist/css/tabler-social.css +10 -0
- package/dist/css/tabler-social.min.css +8 -0
- package/dist/css/tabler-social.rtl.css +10 -0
- package/dist/css/tabler-social.rtl.min.css +8 -0
- package/dist/css/tabler-vendors.css +97 -38
- package/dist/css/tabler-vendors.min.css +3 -3
- package/dist/css/tabler-vendors.rtl.css +97 -38
- package/dist/css/tabler-vendors.rtl.min.css +3 -3
- package/dist/css/tabler.css +3827 -2186
- package/dist/css/tabler.min.css +7 -3
- package/dist/css/tabler.rtl.css +3827 -2187
- package/dist/css/tabler.rtl.min.css +7 -3
- package/dist/img/payments/epayco-dark.svg +1 -0
- package/dist/img/payments/epayco.svg +1 -0
- package/dist/js/demo-theme.js +9 -6
- package/dist/js/demo-theme.min.js +3 -3
- package/dist/js/demo.js +16 -16
- package/dist/js/demo.min.js +2 -2
- package/dist/js/tabler.esm.js +2115 -2970
- package/dist/js/tabler.esm.min.js +6 -6
- package/dist/js/tabler.js +2115 -2970
- package/dist/js/tabler.min.js +6 -6
- package/dist/libs/apexcharts/dist/apexcharts.amd.js +1 -1
- package/dist/libs/apexcharts/dist/apexcharts.common.js +5 -5
- package/dist/libs/apexcharts/dist/apexcharts.esm.js +5 -5
- package/dist/libs/apexcharts/dist/apexcharts.js +3010 -2741
- package/dist/libs/apexcharts/dist/apexcharts.min.js +5 -5
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js +228 -228
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js +196 -195
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.js +197 -196
- package/dist/libs/bootstrap/dist/js/bootstrap.js.map +1 -1
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js +3 -3
- package/dist/libs/bootstrap/dist/js/bootstrap.min.js.map +1 -1
- package/dist/libs/countup.js/dist/countUp.d.ts +8 -3
- package/dist/libs/countup.js/dist/countUp.js +26 -8
- package/dist/libs/countup.js/dist/countUp.min.js +1 -1
- package/dist/libs/countup.js/dist/countUp.umd.js +1 -293
- package/dist/libs/countup.js/dist/requestAnimationFrame.polyfill.js +26 -0
- package/dist/libs/fslightbox/README.md +39 -33
- package/dist/libs/fslightbox/index.js +1 -1
- package/dist/libs/fslightbox/package.json +10 -44
- package/dist/libs/jsvectormap/dist/js/jsvectormap.js +517 -857
- package/dist/libs/jsvectormap/dist/js/jsvectormap.min.js +1 -1
- package/dist/libs/nouislider/dist/nouislider.d.ts +2 -0
- package/dist/libs/nouislider/dist/nouislider.js +28 -0
- package/dist/libs/nouislider/dist/nouislider.min.js +1 -1
- package/dist/libs/nouislider/dist/nouislider.min.mjs +1 -1
- package/dist/libs/nouislider/dist/nouislider.mjs +28 -0
- package/dist/libs/plyr/dist/plyr.css +1 -1
- package/dist/libs/plyr/dist/plyr.js +289 -229
- package/dist/libs/plyr/dist/plyr.min.js +1 -1
- package/dist/libs/plyr/dist/plyr.min.js.map +1 -1
- package/dist/libs/plyr/dist/plyr.min.mjs +1 -1
- package/dist/libs/plyr/dist/plyr.min.mjs.map +1 -1
- package/dist/libs/plyr/dist/plyr.mjs +289 -229
- package/dist/libs/plyr/dist/plyr.polyfilled.js +289 -229
- package/dist/libs/plyr/dist/plyr.polyfilled.min.js +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.min.js.map +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.min.mjs.map +1 -1
- package/dist/libs/plyr/dist/plyr.polyfilled.mjs +289 -229
- package/dist/libs/tinymce/CHANGELOG.md +112 -0
- package/dist/libs/tinymce/composer.json +1 -1
- package/dist/libs/tinymce/icons/default/icons.js +4 -0
- package/dist/libs/tinymce/icons/default/icons.min.js +1 -1
- package/dist/libs/tinymce/models/dom/model.js +79 -23
- package/dist/libs/tinymce/models/dom/model.min.js +2 -2
- package/dist/libs/tinymce/package.json +1 -1
- package/dist/libs/tinymce/plugins/advlist/plugin.js +34 -28
- package/dist/libs/tinymce/plugins/advlist/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/anchor/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/anchor/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/autolink/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/autolink/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/autoresize/plugin.js +46 -11
- package/dist/libs/tinymce/plugins/autoresize/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/autosave/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/autosave/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/charmap/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/charmap/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/code/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/code/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/codesample/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/codesample/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/directionality/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/emoticons/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/emoticons/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/fullscreen/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/help/plugin.js +12 -4
- package/dist/libs/tinymce/plugins/help/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/image/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/image/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/importcss/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/importcss/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/link/plugin.js +21 -7
- package/dist/libs/tinymce/plugins/link/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/lists/plugin.js +132 -50
- package/dist/libs/tinymce/plugins/lists/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/media/plugin.js +7 -2
- package/dist/libs/tinymce/plugins/media/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/pagebreak/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/pagebreak/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/preview/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/preview/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/quickbars/plugin.js +21 -13
- package/dist/libs/tinymce/plugins/quickbars/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/save/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/save/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/searchreplace/plugin.js +56 -43
- package/dist/libs/tinymce/plugins/searchreplace/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/table/plugin.js +73 -55
- package/dist/libs/tinymce/plugins/table/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/template/plugin.js +17 -14
- package/dist/libs/tinymce/plugins/template/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/visualblocks/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/visualblocks/plugin.min.js +1 -1
- package/dist/libs/tinymce/plugins/visualchars/plugin.js +58 -7
- package/dist/libs/tinymce/plugins/visualchars/plugin.min.js +2 -2
- package/dist/libs/tinymce/plugins/wordcount/plugin.js +1 -1
- package/dist/libs/tinymce/plugins/wordcount/plugin.min.js +1 -1
- package/dist/libs/tinymce/skins/ui/oxide/skin.css +454 -6
- package/dist/libs/tinymce/skins/ui/oxide/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.css +454 -6
- package/dist/libs/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.css +455 -6
- package/dist/libs/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.css +454 -5
- package/dist/libs/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/dist/libs/tinymce/themes/silver/theme.js +4374 -3074
- package/dist/libs/tinymce/themes/silver/theme.min.js +2 -2
- package/dist/libs/tinymce/tinymce.d.ts +305 -236
- package/dist/libs/tinymce/tinymce.js +1957 -1597
- package/dist/libs/tinymce/tinymce.min.js +2 -2
- package/package.json +56 -41
- package/src/js/demo-theme.js +13 -10
- package/src/js/demo.js +18 -15
- package/src/js/tabler.esm.js +7 -8
- package/src/js/tabler.js +12 -12
- package/src/scss/_bootstrap-components.scss +33 -33
- package/src/scss/_bootstrap-config.scss +6 -6
- package/src/scss/_bootstrap-override.scss +8 -12
- package/src/scss/_config.scss +2 -1
- package/src/scss/_core.scss +1 -1
- package/src/scss/_debug.scss +41 -30
- package/src/scss/_utilities.scss +21 -19
- package/src/scss/_variables-dark.scss +17 -0
- package/src/scss/_variables.scss +232 -168
- package/src/scss/demo/_examples.scss +0 -16
- package/src/scss/demo.scss +36 -25
- package/src/scss/layout/_core.scss +0 -1
- package/src/scss/layout/_dark.scss +47 -162
- package/src/scss/layout/_navbar.scss +82 -93
- package/src/scss/layout/_page.scss +9 -6
- package/src/scss/layout/_root.scss +21 -7
- package/src/scss/mixins/_functions.scss +2 -6
- package/src/scss/mixins/_mixins.scss +0 -32
- package/src/scss/tabler-social.scss +1 -0
- package/src/scss/tabler.scss +0 -1
- package/src/scss/ui/_avatars.scss +1 -1
- package/src/scss/ui/_buttons.scss +1 -1
- package/src/scss/ui/_dropdowns.scss +1 -3
- package/src/scss/ui/_grid.scss +0 -16
- package/src/scss/ui/_payments.scss +1 -1
- package/src/scss/ui/_status.scss +0 -10
- package/src/scss/ui/_tables.scss +0 -15
- package/src/scss/ui/_timeline.scss +3 -3
- package/src/scss/utils/_colors.scss +6 -2
- package/src/scss/vendor/_apexcharts.scss +16 -0
- package/src/scss/vendor/_jsvectormap.scss +1 -1
- package/src/scss/vendor/_nouislider.scss +1 -1
- package/src/scss/vendor/_tinymce.scss +5 -7
- package/src/scss/vendor/_tom-select.scss +43 -2
- package/dist/libs/countup.js/dist/countUp.withPolyfill.min.js +0 -1
- package/dist/libs/fslightbox/jest-setup.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _defineProperty$1(obj, key, value) {
|
|
2
|
+
key = _toPropertyKey(key);
|
|
2
3
|
if (key in obj) {
|
|
3
4
|
Object.defineProperty(obj, key, {
|
|
4
5
|
value: value,
|
|
@@ -11,6 +12,20 @@ function _defineProperty$1(obj, key, value) {
|
|
|
11
12
|
}
|
|
12
13
|
return obj;
|
|
13
14
|
}
|
|
15
|
+
function _toPrimitive(input, hint) {
|
|
16
|
+
if (typeof input !== "object" || input === null) return input;
|
|
17
|
+
var prim = input[Symbol.toPrimitive];
|
|
18
|
+
if (prim !== undefined) {
|
|
19
|
+
var res = prim.call(input, hint || "default");
|
|
20
|
+
if (typeof res !== "object") return res;
|
|
21
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
22
|
+
}
|
|
23
|
+
return (hint === "string" ? String : Number)(input);
|
|
24
|
+
}
|
|
25
|
+
function _toPropertyKey(arg) {
|
|
26
|
+
var key = _toPrimitive(arg, "string");
|
|
27
|
+
return typeof key === "symbol" ? key : String(key);
|
|
28
|
+
}
|
|
14
29
|
|
|
15
30
|
function _classCallCheck(e, t) {
|
|
16
31
|
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
@@ -312,12 +327,20 @@ function repaint(element, delay) {
|
|
|
312
327
|
// Unfortunately, due to mixed support, UA sniffing is required
|
|
313
328
|
// ==========================================================================
|
|
314
329
|
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
330
|
+
const isIE = Boolean(window.document.documentMode);
|
|
331
|
+
const isEdge = /Edge/g.test(navigator.userAgent);
|
|
332
|
+
const isWebKit = 'WebkitAppearance' in document.documentElement.style && !/Edge/g.test(navigator.userAgent);
|
|
333
|
+
const isIPhone = /iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
|
|
334
|
+
// navigator.platform may be deprecated but this check is still required
|
|
335
|
+
const isIPadOS = navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;
|
|
336
|
+
const isIos = /iPad|iPhone|iPod/gi.test(navigator.userAgent) && navigator.maxTouchPoints > 1;
|
|
337
|
+
var browser = {
|
|
338
|
+
isIE,
|
|
339
|
+
isEdge,
|
|
340
|
+
isWebKit,
|
|
341
|
+
isIPhone,
|
|
342
|
+
isIPadOS,
|
|
343
|
+
isIos
|
|
321
344
|
};
|
|
322
345
|
|
|
323
346
|
// ==========================================================================
|
|
@@ -390,9 +413,7 @@ function wrap(elements, wrapper) {
|
|
|
390
413
|
|
|
391
414
|
// Set attributes
|
|
392
415
|
function setAttributes(element, attributes) {
|
|
393
|
-
if (!is.element(element) || is.empty(attributes))
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
416
|
+
if (!is.element(element) || is.empty(attributes)) return;
|
|
396
417
|
|
|
397
418
|
// Assume null and undefined attributes should be left out,
|
|
398
419
|
// Setting them would otherwise convert them to "null" and "undefined"
|
|
@@ -418,19 +439,15 @@ function createElement(type, attributes, text) {
|
|
|
418
439
|
return element;
|
|
419
440
|
}
|
|
420
441
|
|
|
421
|
-
//
|
|
442
|
+
// Insert an element after another
|
|
422
443
|
function insertAfter(element, target) {
|
|
423
|
-
if (!is.element(element) || !is.element(target))
|
|
424
|
-
return;
|
|
425
|
-
}
|
|
444
|
+
if (!is.element(element) || !is.element(target)) return;
|
|
426
445
|
target.parentNode.insertBefore(element, target.nextSibling);
|
|
427
446
|
}
|
|
428
447
|
|
|
429
448
|
// Insert a DocumentFragment
|
|
430
449
|
function insertElement(type, parent, attributes, text) {
|
|
431
|
-
if (!is.element(parent))
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
450
|
+
if (!is.element(parent)) return;
|
|
434
451
|
parent.appendChild(createElement(type, attributes, text));
|
|
435
452
|
}
|
|
436
453
|
|
|
@@ -448,9 +465,7 @@ function removeElement(element) {
|
|
|
448
465
|
|
|
449
466
|
// Remove all child elements
|
|
450
467
|
function emptyElement(element) {
|
|
451
|
-
if (!is.element(element))
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
468
|
+
if (!is.element(element)) return;
|
|
454
469
|
let {
|
|
455
470
|
length
|
|
456
471
|
} = element.childNodes;
|
|
@@ -462,9 +477,7 @@ function emptyElement(element) {
|
|
|
462
477
|
|
|
463
478
|
// Replace element
|
|
464
479
|
function replaceElement(newChild, oldChild) {
|
|
465
|
-
if (!is.element(oldChild) || !is.element(oldChild.parentNode) || !is.element(newChild))
|
|
466
|
-
return null;
|
|
467
|
-
}
|
|
480
|
+
if (!is.element(oldChild) || !is.element(oldChild.parentNode) || !is.element(newChild)) return null;
|
|
468
481
|
oldChild.parentNode.replaceChild(newChild, oldChild);
|
|
469
482
|
return newChild;
|
|
470
483
|
}
|
|
@@ -476,9 +489,7 @@ function getAttributesFromSelector(sel, existingAttributes) {
|
|
|
476
489
|
// '#test' to { id: 'test' }
|
|
477
490
|
// '[data-test="test"]' to { 'data-test': 'test' }
|
|
478
491
|
|
|
479
|
-
if (!is.string(sel) || is.empty(sel)) {
|
|
480
|
-
return {};
|
|
481
|
-
}
|
|
492
|
+
if (!is.string(sel) || is.empty(sel)) return {};
|
|
482
493
|
const attributes = {};
|
|
483
494
|
const existing = extend({}, existingAttributes);
|
|
484
495
|
sel.split(',').forEach(s => {
|
|
@@ -516,9 +527,7 @@ function getAttributesFromSelector(sel, existingAttributes) {
|
|
|
516
527
|
|
|
517
528
|
// Toggle hidden
|
|
518
529
|
function toggleHidden(element, hidden) {
|
|
519
|
-
if (!is.element(element))
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
530
|
+
if (!is.element(element)) return;
|
|
522
531
|
let hide = hidden;
|
|
523
532
|
if (!is.boolean(hide)) {
|
|
524
533
|
hide = !element.hidden;
|
|
@@ -591,20 +600,14 @@ function getElement(selector) {
|
|
|
591
600
|
}
|
|
592
601
|
|
|
593
602
|
// Set focus and tab focus class
|
|
594
|
-
function setFocus(element = null,
|
|
595
|
-
if (!is.element(element))
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
603
|
+
function setFocus(element = null, focusVisible = false) {
|
|
604
|
+
if (!is.element(element)) return;
|
|
598
605
|
|
|
599
606
|
// Set regular focus
|
|
600
607
|
element.focus({
|
|
601
|
-
preventScroll: true
|
|
608
|
+
preventScroll: true,
|
|
609
|
+
focusVisible
|
|
602
610
|
});
|
|
603
|
-
|
|
604
|
-
// If we want to mimic keyboard focus via tab
|
|
605
|
-
if (tabFocus) {
|
|
606
|
-
toggleClass(element, this.config.classNames.tabFocus);
|
|
607
|
-
}
|
|
608
611
|
}
|
|
609
612
|
|
|
610
613
|
// ==========================================================================
|
|
@@ -625,10 +628,9 @@ const support = {
|
|
|
625
628
|
video: 'canPlayType' in document.createElement('video'),
|
|
626
629
|
// Check for support
|
|
627
630
|
// Basic functionality vs full UI
|
|
628
|
-
check(type, provider
|
|
629
|
-
const canPlayInline = browser.isIPhone && playsinline && support.playsinline;
|
|
631
|
+
check(type, provider) {
|
|
630
632
|
const api = support[type] || provider !== 'html5';
|
|
631
|
-
const ui = api && support.rangeInput
|
|
633
|
+
const ui = api && support.rangeInput;
|
|
632
634
|
return {
|
|
633
635
|
api,
|
|
634
636
|
ui
|
|
@@ -1125,7 +1127,7 @@ function generateId(prefix) {
|
|
|
1125
1127
|
// Format string
|
|
1126
1128
|
function format(input, ...args) {
|
|
1127
1129
|
if (is.empty(input)) return input;
|
|
1128
|
-
return input.toString().replace(/{(\d+)}/g, (
|
|
1130
|
+
return input.toString().replace(/{(\d+)}/g, (_, i) => args[i].toString());
|
|
1129
1131
|
}
|
|
1130
1132
|
|
|
1131
1133
|
// Get percentage
|
|
@@ -1706,7 +1708,8 @@ const controls = {
|
|
|
1706
1708
|
const attributes = getAttributesFromSelector(this.config.selectors.display[type], attrs);
|
|
1707
1709
|
const container = createElement('div', extend(attributes, {
|
|
1708
1710
|
class: `${attributes.class ? attributes.class : ''} ${this.config.classNames.display.time} `.trim(),
|
|
1709
|
-
'aria-label': i18n.get(type, this.config)
|
|
1711
|
+
'aria-label': i18n.get(type, this.config),
|
|
1712
|
+
role: 'timer'
|
|
1710
1713
|
}), '00:00');
|
|
1711
1714
|
|
|
1712
1715
|
// Reference for updates
|
|
@@ -1720,7 +1723,7 @@ const controls = {
|
|
|
1720
1723
|
// Navigate through menus via arrow keys and space
|
|
1721
1724
|
on.call(this, menuItem, 'keydown keyup', event => {
|
|
1722
1725
|
// We only care about space and ⬆️ ⬇️️ ➡️
|
|
1723
|
-
if (!['
|
|
1726
|
+
if (![' ', 'ArrowUp', 'ArrowDown', 'ArrowRight'].includes(event.key)) {
|
|
1724
1727
|
return;
|
|
1725
1728
|
}
|
|
1726
1729
|
|
|
@@ -1735,11 +1738,11 @@ const controls = {
|
|
|
1735
1738
|
const isRadioButton = matches(menuItem, '[role="menuitemradio"]');
|
|
1736
1739
|
|
|
1737
1740
|
// Show the respective menu
|
|
1738
|
-
if (!isRadioButton && ['
|
|
1741
|
+
if (!isRadioButton && [' ', 'ArrowRight'].includes(event.key)) {
|
|
1739
1742
|
controls.showMenuPanel.call(this, type, true);
|
|
1740
1743
|
} else {
|
|
1741
1744
|
let target;
|
|
1742
|
-
if (event.key !== '
|
|
1745
|
+
if (event.key !== ' ') {
|
|
1743
1746
|
if (event.key === 'ArrowDown' || isRadioButton && event.key === 'ArrowRight') {
|
|
1744
1747
|
target = menuItem.nextElementSibling;
|
|
1745
1748
|
if (!is.element(target)) {
|
|
@@ -1804,7 +1807,7 @@ const controls = {
|
|
|
1804
1807
|
}
|
|
1805
1808
|
});
|
|
1806
1809
|
this.listeners.bind(menuItem, 'click keyup', event => {
|
|
1807
|
-
if (is.keyboardEvent(event) && event.key !== '
|
|
1810
|
+
if (is.keyboardEvent(event) && event.key !== ' ') {
|
|
1808
1811
|
return;
|
|
1809
1812
|
}
|
|
1810
1813
|
event.preventDefault();
|
|
@@ -1944,7 +1947,7 @@ const controls = {
|
|
|
1944
1947
|
}
|
|
1945
1948
|
|
|
1946
1949
|
// WebKit only
|
|
1947
|
-
if (!browser.
|
|
1950
|
+
if (!browser.isWebKit && !browser.isIPadOS) {
|
|
1948
1951
|
return;
|
|
1949
1952
|
}
|
|
1950
1953
|
|
|
@@ -2327,7 +2330,7 @@ const controls = {
|
|
|
2327
2330
|
toggleHidden(this.elements.settings.menu, !visible);
|
|
2328
2331
|
},
|
|
2329
2332
|
// Focus the first menu item in a given (or visible) menu
|
|
2330
|
-
focusFirstMenuItem(pane,
|
|
2333
|
+
focusFirstMenuItem(pane, focusVisible = false) {
|
|
2331
2334
|
if (this.elements.settings.popup.hidden) {
|
|
2332
2335
|
return;
|
|
2333
2336
|
}
|
|
@@ -2336,7 +2339,7 @@ const controls = {
|
|
|
2336
2339
|
target = Object.values(this.elements.settings.panels).find(p => !p.hidden);
|
|
2337
2340
|
}
|
|
2338
2341
|
const firstItem = target.querySelector('[role^="menuitem"]');
|
|
2339
|
-
setFocus.call(this, firstItem,
|
|
2342
|
+
setFocus.call(this, firstItem, focusVisible);
|
|
2340
2343
|
},
|
|
2341
2344
|
// Show/hide menu
|
|
2342
2345
|
toggleMenu(input) {
|
|
@@ -2412,7 +2415,7 @@ const controls = {
|
|
|
2412
2415
|
};
|
|
2413
2416
|
},
|
|
2414
2417
|
// Show a panel in the menu
|
|
2415
|
-
showMenuPanel(type = '',
|
|
2418
|
+
showMenuPanel(type = '', focusVisible = false) {
|
|
2416
2419
|
const target = this.elements.container.querySelector(`#plyr-settings-${this.id}-${type}`);
|
|
2417
2420
|
|
|
2418
2421
|
// Nothing to show, bail
|
|
@@ -2463,7 +2466,7 @@ const controls = {
|
|
|
2463
2466
|
toggleHidden(target, false);
|
|
2464
2467
|
|
|
2465
2468
|
// Focus the first item
|
|
2466
|
-
controls.focusFirstMenuItem.call(this, target,
|
|
2469
|
+
controls.focusFirstMenuItem.call(this, target, focusVisible);
|
|
2467
2470
|
},
|
|
2468
2471
|
// Set the download URL
|
|
2469
2472
|
setDownloadUrl() {
|
|
@@ -2590,7 +2593,7 @@ const controls = {
|
|
|
2590
2593
|
// Volume range control
|
|
2591
2594
|
// Ignored on iOS as it's handled globally
|
|
2592
2595
|
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
|
|
2593
|
-
if (control === 'volume' && !browser.isIos) {
|
|
2596
|
+
if (control === 'volume' && !browser.isIos && !browser.isIPadOS) {
|
|
2594
2597
|
// Set the attributes
|
|
2595
2598
|
const attributes = {
|
|
2596
2599
|
max: 1,
|
|
@@ -3382,8 +3385,7 @@ const defaults = {
|
|
|
3382
3385
|
autoplay: false,
|
|
3383
3386
|
// Only allow one media playing at once (vimeo only)
|
|
3384
3387
|
autopause: true,
|
|
3385
|
-
// Allow inline playback on iOS
|
|
3386
|
-
// TODO: Remove iosNative fullscreen option in favour of this (logic needs work)
|
|
3388
|
+
// Allow inline playback on iOS
|
|
3387
3389
|
playsinline: true,
|
|
3388
3390
|
// Default time to skip when rewind/fast forward
|
|
3389
3391
|
seekTime: 10,
|
|
@@ -3413,7 +3415,7 @@ const defaults = {
|
|
|
3413
3415
|
// Sprite (for icons)
|
|
3414
3416
|
loadSprite: true,
|
|
3415
3417
|
iconPrefix: 'plyr',
|
|
3416
|
-
iconUrl: 'https://cdn.plyr.io/3.7.
|
|
3418
|
+
iconUrl: 'https://cdn.plyr.io/3.7.8/plyr.svg',
|
|
3417
3419
|
// Blank video (used to prevent errors on source change)
|
|
3418
3420
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
|
3419
3421
|
// Quality default
|
|
@@ -3646,7 +3648,6 @@ const defaults = {
|
|
|
3646
3648
|
marker: 'plyr__progress__marker',
|
|
3647
3649
|
hidden: 'plyr__sr-only',
|
|
3648
3650
|
hideControls: 'plyr--hide-controls',
|
|
3649
|
-
isIos: 'plyr--is-ios',
|
|
3650
3651
|
isTouch: 'plyr--is-touch',
|
|
3651
3652
|
uiSupported: 'plyr--full-ui',
|
|
3652
3653
|
noTransition: 'plyr--no-transition',
|
|
@@ -3674,7 +3675,6 @@ const defaults = {
|
|
|
3674
3675
|
supported: 'plyr--airplay-supported',
|
|
3675
3676
|
active: 'plyr--airplay-active'
|
|
3676
3677
|
},
|
|
3677
|
-
tabFocus: 'plyr__tab-focus',
|
|
3678
3678
|
previewThumbnails: {
|
|
3679
3679
|
// Tooltip thumbs
|
|
3680
3680
|
thumbContainer: 'plyr__preview-thumb',
|
|
@@ -3819,9 +3819,7 @@ class Console {
|
|
|
3819
3819
|
class Fullscreen {
|
|
3820
3820
|
constructor(player) {
|
|
3821
3821
|
_defineProperty$1(this, "onChange", () => {
|
|
3822
|
-
if (!this.
|
|
3823
|
-
return;
|
|
3824
|
-
}
|
|
3822
|
+
if (!this.supported) return;
|
|
3825
3823
|
|
|
3826
3824
|
// Update toggle button
|
|
3827
3825
|
const button = this.player.elements.buttons.fullscreen;
|
|
@@ -3838,8 +3836,8 @@ class Fullscreen {
|
|
|
3838
3836
|
// Store or restore scroll position
|
|
3839
3837
|
if (toggle) {
|
|
3840
3838
|
this.scrollPosition = {
|
|
3841
|
-
x: window.scrollX
|
|
3842
|
-
y: window.scrollY
|
|
3839
|
+
x: window.scrollX ?? 0,
|
|
3840
|
+
y: window.scrollY ?? 0
|
|
3843
3841
|
};
|
|
3844
3842
|
} else {
|
|
3845
3843
|
window.scrollTo(this.scrollPosition.x, this.scrollPosition.y);
|
|
@@ -3866,9 +3864,7 @@ class Fullscreen {
|
|
|
3866
3864
|
const hasProperty = is.string(viewport.content) && viewport.content.includes(property);
|
|
3867
3865
|
if (toggle) {
|
|
3868
3866
|
this.cleanupViewport = !hasProperty;
|
|
3869
|
-
if (!hasProperty) {
|
|
3870
|
-
viewport.content += `,${property}`;
|
|
3871
|
-
}
|
|
3867
|
+
if (!hasProperty) viewport.content += `,${property}`;
|
|
3872
3868
|
} else if (this.cleanupViewport) {
|
|
3873
3869
|
viewport.content = viewport.content.split(',').filter(part => part.trim() !== property).join(',');
|
|
3874
3870
|
}
|
|
@@ -3877,11 +3873,10 @@ class Fullscreen {
|
|
|
3877
3873
|
// Toggle button and fire events
|
|
3878
3874
|
this.onChange();
|
|
3879
3875
|
});
|
|
3876
|
+
// Trap focus inside container
|
|
3880
3877
|
_defineProperty$1(this, "trapFocus", event => {
|
|
3881
|
-
// Bail if iOS, not active, not the tab key
|
|
3882
|
-
if (browser.isIos || !this.active || event.key !== 'Tab')
|
|
3883
|
-
return;
|
|
3884
|
-
}
|
|
3878
|
+
// Bail if iOS/iPadOS, not active, not the tab key
|
|
3879
|
+
if (browser.isIos || browser.isIPadOS || !this.active || event.key !== 'Tab') return;
|
|
3885
3880
|
|
|
3886
3881
|
// Get the current focused element
|
|
3887
3882
|
const focused = document.activeElement;
|
|
@@ -3898,28 +3893,22 @@ class Fullscreen {
|
|
|
3898
3893
|
event.preventDefault();
|
|
3899
3894
|
}
|
|
3900
3895
|
});
|
|
3896
|
+
// Update UI
|
|
3901
3897
|
_defineProperty$1(this, "update", () => {
|
|
3902
|
-
if (this.
|
|
3898
|
+
if (this.supported) {
|
|
3903
3899
|
let mode;
|
|
3904
|
-
if (this.forceFallback)
|
|
3905
|
-
mode = 'Fallback (forced)';
|
|
3906
|
-
} else if (Fullscreen.native) {
|
|
3907
|
-
mode = 'Native';
|
|
3908
|
-
} else {
|
|
3909
|
-
mode = 'Fallback';
|
|
3910
|
-
}
|
|
3900
|
+
if (this.forceFallback) mode = 'Fallback (forced)';else if (Fullscreen.nativeSupported) mode = 'Native';else mode = 'Fallback';
|
|
3911
3901
|
this.player.debug.log(`${mode} fullscreen enabled`);
|
|
3912
3902
|
} else {
|
|
3913
3903
|
this.player.debug.log('Fullscreen not supported and fallback disabled');
|
|
3914
3904
|
}
|
|
3915
3905
|
|
|
3916
3906
|
// Add styling hook to show button
|
|
3917
|
-
toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.
|
|
3907
|
+
toggleClass(this.player.elements.container, this.player.config.classNames.fullscreen.enabled, this.supported);
|
|
3918
3908
|
});
|
|
3909
|
+
// Make an element fullscreen
|
|
3919
3910
|
_defineProperty$1(this, "enter", () => {
|
|
3920
|
-
if (!this.
|
|
3921
|
-
return;
|
|
3922
|
-
}
|
|
3911
|
+
if (!this.supported) return;
|
|
3923
3912
|
|
|
3924
3913
|
// iOS native fullscreen doesn't need the request step
|
|
3925
3914
|
if (browser.isIos && this.player.config.fullscreen.iosNative) {
|
|
@@ -3928,7 +3917,7 @@ class Fullscreen {
|
|
|
3928
3917
|
} else {
|
|
3929
3918
|
this.target.webkitEnterFullscreen();
|
|
3930
3919
|
}
|
|
3931
|
-
} else if (!Fullscreen.
|
|
3920
|
+
} else if (!Fullscreen.nativeSupported || this.forceFallback) {
|
|
3932
3921
|
this.toggleFallback(true);
|
|
3933
3922
|
} else if (!this.prefix) {
|
|
3934
3923
|
this.target.requestFullscreen({
|
|
@@ -3938,16 +3927,19 @@ class Fullscreen {
|
|
|
3938
3927
|
this.target[`${this.prefix}Request${this.property}`]();
|
|
3939
3928
|
}
|
|
3940
3929
|
});
|
|
3930
|
+
// Bail from fullscreen
|
|
3941
3931
|
_defineProperty$1(this, "exit", () => {
|
|
3942
|
-
if (!this.
|
|
3943
|
-
return;
|
|
3944
|
-
}
|
|
3932
|
+
if (!this.supported) return;
|
|
3945
3933
|
|
|
3946
3934
|
// iOS native fullscreen
|
|
3947
3935
|
if (browser.isIos && this.player.config.fullscreen.iosNative) {
|
|
3948
|
-
this.
|
|
3936
|
+
if (this.player.isVimeo) {
|
|
3937
|
+
this.player.embed.exitFullscreen();
|
|
3938
|
+
} else {
|
|
3939
|
+
this.target.webkitEnterFullscreen();
|
|
3940
|
+
}
|
|
3949
3941
|
silencePromise(this.player.play());
|
|
3950
|
-
} else if (!Fullscreen.
|
|
3942
|
+
} else if (!Fullscreen.nativeSupported || this.forceFallback) {
|
|
3951
3943
|
this.toggleFallback(false);
|
|
3952
3944
|
} else if (!this.prefix) {
|
|
3953
3945
|
(document.cancelFullScreen || document.exitFullscreen).call(document);
|
|
@@ -3956,12 +3948,9 @@ class Fullscreen {
|
|
|
3956
3948
|
document[`${this.prefix}${action}${this.property}`]();
|
|
3957
3949
|
}
|
|
3958
3950
|
});
|
|
3951
|
+
// Toggle state
|
|
3959
3952
|
_defineProperty$1(this, "toggle", () => {
|
|
3960
|
-
if (!this.active)
|
|
3961
|
-
this.enter();
|
|
3962
|
-
} else {
|
|
3963
|
-
this.exit();
|
|
3964
|
-
}
|
|
3953
|
+
if (!this.active) this.enter();else this.exit();
|
|
3965
3954
|
});
|
|
3966
3955
|
// Keep reference to parent
|
|
3967
3956
|
this.player = player;
|
|
@@ -4004,26 +3993,22 @@ class Fullscreen {
|
|
|
4004
3993
|
|
|
4005
3994
|
// Update the UI
|
|
4006
3995
|
this.update();
|
|
4007
|
-
|
|
4008
|
-
// this.toggle = this.toggle.bind(this);
|
|
4009
3996
|
}
|
|
4010
3997
|
|
|
4011
3998
|
// Determine if native supported
|
|
4012
|
-
static get
|
|
3999
|
+
static get nativeSupported() {
|
|
4013
4000
|
return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
|
|
4014
4001
|
}
|
|
4015
4002
|
|
|
4016
4003
|
// If we're actually using native
|
|
4017
|
-
get
|
|
4018
|
-
return Fullscreen.
|
|
4004
|
+
get useNative() {
|
|
4005
|
+
return Fullscreen.nativeSupported && !this.forceFallback;
|
|
4019
4006
|
}
|
|
4020
4007
|
|
|
4021
4008
|
// Get the prefix for handlers
|
|
4022
4009
|
static get prefix() {
|
|
4023
4010
|
// No prefix
|
|
4024
|
-
if (is.function(document.exitFullscreen))
|
|
4025
|
-
return '';
|
|
4026
|
-
}
|
|
4011
|
+
if (is.function(document.exitFullscreen)) return '';
|
|
4027
4012
|
|
|
4028
4013
|
// Check for fullscreen support by vendor prefix
|
|
4029
4014
|
let value = '';
|
|
@@ -4041,19 +4026,26 @@ class Fullscreen {
|
|
|
4041
4026
|
return this.prefix === 'moz' ? 'FullScreen' : 'Fullscreen';
|
|
4042
4027
|
}
|
|
4043
4028
|
|
|
4044
|
-
// Determine if fullscreen is
|
|
4045
|
-
get
|
|
4046
|
-
return
|
|
4029
|
+
// Determine if fullscreen is supported
|
|
4030
|
+
get supported() {
|
|
4031
|
+
return [
|
|
4032
|
+
// Fullscreen is enabled in config
|
|
4033
|
+
this.player.config.fullscreen.enabled,
|
|
4034
|
+
// Must be a video
|
|
4035
|
+
this.player.isVideo,
|
|
4036
|
+
// Either native is supported or fallback enabled
|
|
4037
|
+
Fullscreen.nativeSupported || this.player.config.fullscreen.fallback,
|
|
4038
|
+
// YouTube has no way to trigger fullscreen, so on devices with no native support, playsinline
|
|
4039
|
+
// must be enabled and iosNative fullscreen must be disabled to offer the fullscreen fallback
|
|
4040
|
+
!this.player.isYouTube || Fullscreen.nativeSupported || !browser.isIos || this.player.config.playsinline && !this.player.config.fullscreen.iosNative].every(Boolean);
|
|
4047
4041
|
}
|
|
4048
4042
|
|
|
4049
4043
|
// Get active state
|
|
4050
4044
|
get active() {
|
|
4051
|
-
if (!this.
|
|
4052
|
-
return false;
|
|
4053
|
-
}
|
|
4045
|
+
if (!this.supported) return false;
|
|
4054
4046
|
|
|
4055
4047
|
// Fallback using classname
|
|
4056
|
-
if (!Fullscreen.
|
|
4048
|
+
if (!Fullscreen.nativeSupported || this.forceFallback) {
|
|
4057
4049
|
return hasClass(this.target, this.player.config.classNames.fullscreen.fallback);
|
|
4058
4050
|
}
|
|
4059
4051
|
const element = !this.prefix ? this.target.getRootNode().fullscreenElement : this.target.getRootNode()[`${this.prefix}${this.property}Element`];
|
|
@@ -4062,7 +4054,7 @@ class Fullscreen {
|
|
|
4062
4054
|
|
|
4063
4055
|
// Get target element
|
|
4064
4056
|
get target() {
|
|
4065
|
-
return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.fullscreen
|
|
4057
|
+
return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.fullscreen ?? this.player.elements.container;
|
|
4066
4058
|
}
|
|
4067
4059
|
}
|
|
4068
4060
|
|
|
@@ -4169,9 +4161,6 @@ const ui = {
|
|
|
4169
4161
|
// Check for airplay support
|
|
4170
4162
|
toggleClass(this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5);
|
|
4171
4163
|
|
|
4172
|
-
// Add iOS class
|
|
4173
|
-
toggleClass(this.elements.container, this.config.classNames.isIos, browser.isIos);
|
|
4174
|
-
|
|
4175
4164
|
// Add touch class
|
|
4176
4165
|
toggleClass(this.elements.container, this.config.classNames.isTouch, this.touch);
|
|
4177
4166
|
|
|
@@ -4350,6 +4339,7 @@ const ui = {
|
|
|
4350
4339
|
|
|
4351
4340
|
class Listeners {
|
|
4352
4341
|
constructor(_player) {
|
|
4342
|
+
// Device is touch enabled
|
|
4353
4343
|
_defineProperty$1(this, "firstTouch", () => {
|
|
4354
4344
|
const {
|
|
4355
4345
|
player
|
|
@@ -4362,62 +4352,7 @@ class Listeners {
|
|
|
4362
4352
|
// Add touch class
|
|
4363
4353
|
toggleClass(elements.container, player.config.classNames.isTouch, true);
|
|
4364
4354
|
});
|
|
4365
|
-
|
|
4366
|
-
const {
|
|
4367
|
-
player
|
|
4368
|
-
} = this;
|
|
4369
|
-
const {
|
|
4370
|
-
elements
|
|
4371
|
-
} = player;
|
|
4372
|
-
const {
|
|
4373
|
-
key,
|
|
4374
|
-
type,
|
|
4375
|
-
timeStamp
|
|
4376
|
-
} = event;
|
|
4377
|
-
clearTimeout(this.focusTimer);
|
|
4378
|
-
|
|
4379
|
-
// Ignore any key other than tab
|
|
4380
|
-
if (type === 'keydown' && key !== 'Tab') {
|
|
4381
|
-
return;
|
|
4382
|
-
}
|
|
4383
|
-
|
|
4384
|
-
// Store reference to event timeStamp
|
|
4385
|
-
if (type === 'keydown') {
|
|
4386
|
-
this.lastKeyDown = timeStamp;
|
|
4387
|
-
}
|
|
4388
|
-
|
|
4389
|
-
// Remove current classes
|
|
4390
|
-
const removeCurrent = () => {
|
|
4391
|
-
const className = player.config.classNames.tabFocus;
|
|
4392
|
-
const current = getElements.call(player, `.${className}`);
|
|
4393
|
-
toggleClass(current, className, false);
|
|
4394
|
-
};
|
|
4395
|
-
|
|
4396
|
-
// Determine if a key was pressed to trigger this event
|
|
4397
|
-
const wasKeyDown = timeStamp - this.lastKeyDown <= 20;
|
|
4398
|
-
|
|
4399
|
-
// Ignore focus events if a key was pressed prior
|
|
4400
|
-
if (type === 'focus' && !wasKeyDown) {
|
|
4401
|
-
return;
|
|
4402
|
-
}
|
|
4403
|
-
|
|
4404
|
-
// Remove all current
|
|
4405
|
-
removeCurrent();
|
|
4406
|
-
|
|
4407
|
-
// Delay the adding of classname until the focus has changed
|
|
4408
|
-
// This event fires before the focusin event
|
|
4409
|
-
if (type !== 'focusout') {
|
|
4410
|
-
this.focusTimer = setTimeout(() => {
|
|
4411
|
-
const focused = document.activeElement;
|
|
4412
|
-
|
|
4413
|
-
// Ignore if current focus element isn't inside the player
|
|
4414
|
-
if (!elements.container.contains(focused)) {
|
|
4415
|
-
return;
|
|
4416
|
-
}
|
|
4417
|
-
toggleClass(document.activeElement, player.config.classNames.tabFocus, true);
|
|
4418
|
-
}, 10);
|
|
4419
|
-
}
|
|
4420
|
-
});
|
|
4355
|
+
// Global window & document listeners
|
|
4421
4356
|
_defineProperty$1(this, "global", (toggle = true) => {
|
|
4422
4357
|
const {
|
|
4423
4358
|
player
|
|
@@ -4433,10 +4368,8 @@ class Listeners {
|
|
|
4433
4368
|
|
|
4434
4369
|
// Detect touch by events
|
|
4435
4370
|
once.call(player, document.body, 'touchstart', this.firstTouch);
|
|
4436
|
-
|
|
4437
|
-
// Tab focus detection
|
|
4438
|
-
toggleListener.call(player, document.body, 'keydown focus blur focusout', this.setTabFocus, toggle, false, true);
|
|
4439
4371
|
});
|
|
4372
|
+
// Container listeners
|
|
4440
4373
|
_defineProperty$1(this, "container", () => {
|
|
4441
4374
|
const {
|
|
4442
4375
|
player
|
|
@@ -4544,6 +4477,7 @@ class Listeners {
|
|
|
4544
4477
|
method.call(player, window, 'resize', resized);
|
|
4545
4478
|
});
|
|
4546
4479
|
});
|
|
4480
|
+
// Listen for media events
|
|
4547
4481
|
_defineProperty$1(this, "media", () => {
|
|
4548
4482
|
const {
|
|
4549
4483
|
player
|
|
@@ -4671,6 +4605,7 @@ class Listeners {
|
|
|
4671
4605
|
triggerEvent.call(player, elements.container, event.type, true, detail);
|
|
4672
4606
|
});
|
|
4673
4607
|
});
|
|
4608
|
+
// Run default and custom handlers
|
|
4674
4609
|
_defineProperty$1(this, "proxy", (event, defaultHandler, customHandlerKey) => {
|
|
4675
4610
|
const {
|
|
4676
4611
|
player
|
|
@@ -4689,6 +4624,7 @@ class Listeners {
|
|
|
4689
4624
|
defaultHandler.call(player, event);
|
|
4690
4625
|
}
|
|
4691
4626
|
});
|
|
4627
|
+
// Trigger custom and default handlers
|
|
4692
4628
|
_defineProperty$1(this, "bind", (element, type, defaultHandler, customHandlerKey, passive = true) => {
|
|
4693
4629
|
const {
|
|
4694
4630
|
player
|
|
@@ -4697,6 +4633,7 @@ class Listeners {
|
|
|
4697
4633
|
const hasCustomHandler = is.function(customHandler);
|
|
4698
4634
|
on.call(player, element, type, event => this.proxy(event, defaultHandler, customHandlerKey), passive && !hasCustomHandler);
|
|
4699
4635
|
});
|
|
4636
|
+
// Listen for control events
|
|
4700
4637
|
_defineProperty$1(this, "controls", () => {
|
|
4701
4638
|
const {
|
|
4702
4639
|
player
|
|
@@ -4771,7 +4708,7 @@ class Listeners {
|
|
|
4771
4708
|
// We have to bind to keyup otherwise Firefox triggers a click when a keydown event handler shifts focus
|
|
4772
4709
|
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220143
|
|
4773
4710
|
this.bind(elements.buttons.settings, 'keyup', event => {
|
|
4774
|
-
if (!['
|
|
4711
|
+
if (![' ', 'Enter'].includes(event.key)) {
|
|
4775
4712
|
return;
|
|
4776
4713
|
}
|
|
4777
4714
|
|
|
@@ -4895,7 +4832,7 @@ class Listeners {
|
|
|
4895
4832
|
});
|
|
4896
4833
|
|
|
4897
4834
|
// Polyfill for lower fill in <input type="range"> for webkit
|
|
4898
|
-
if (browser.
|
|
4835
|
+
if (browser.isWebKit) {
|
|
4899
4836
|
Array.from(getElements.call(player, 'input[type="range"]')).forEach(element => {
|
|
4900
4837
|
this.bind(element, 'input', event => controls.updateRangeFill.call(player, event.target));
|
|
4901
4838
|
});
|
|
@@ -4996,7 +4933,6 @@ class Listeners {
|
|
|
4996
4933
|
this.lastKeyDown = null;
|
|
4997
4934
|
this.handleKey = this.handleKey.bind(this);
|
|
4998
4935
|
this.toggleMenu = this.toggleMenu.bind(this);
|
|
4999
|
-
this.setTabFocus = this.setTabFocus.bind(this);
|
|
5000
4936
|
this.firstTouch = this.firstTouch.bind(this);
|
|
5001
4937
|
}
|
|
5002
4938
|
|
|
@@ -5053,13 +4989,13 @@ class Listeners {
|
|
|
5053
4989
|
if (focused !== seek && matches(focused, editable)) {
|
|
5054
4990
|
return;
|
|
5055
4991
|
}
|
|
5056
|
-
if (event.key === '
|
|
4992
|
+
if (event.key === ' ' && matches(focused, 'button, [role^="menuitem"]')) {
|
|
5057
4993
|
return;
|
|
5058
4994
|
}
|
|
5059
4995
|
}
|
|
5060
4996
|
|
|
5061
4997
|
// Which keys should we prevent default
|
|
5062
|
-
const preventDefault = ['
|
|
4998
|
+
const preventDefault = [' ', 'ArrowLeft', 'ArrowUp', 'ArrowRight', 'ArrowDown', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'c', 'f', 'k', 'l', 'm'];
|
|
5063
4999
|
|
|
5064
5000
|
// If the key is found prevent default (e.g. prevent scrolling for arrows)
|
|
5065
5001
|
if (preventDefault.includes(key)) {
|
|
@@ -5081,7 +5017,7 @@ class Listeners {
|
|
|
5081
5017
|
seekByIncrement(parseInt(key, 10));
|
|
5082
5018
|
}
|
|
5083
5019
|
break;
|
|
5084
|
-
case '
|
|
5020
|
+
case ' ':
|
|
5085
5021
|
case 'k':
|
|
5086
5022
|
if (!repeat) {
|
|
5087
5023
|
silencePromise(player.togglePlay());
|
|
@@ -5134,8 +5070,6 @@ class Listeners {
|
|
|
5134
5070
|
toggleMenu(event) {
|
|
5135
5071
|
controls.toggleMenu.call(this.player, event);
|
|
5136
5072
|
}
|
|
5137
|
-
|
|
5138
|
-
// Device is touch enabled
|
|
5139
5073
|
}
|
|
5140
5074
|
|
|
5141
5075
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -5547,7 +5481,7 @@ const vimeo = {
|
|
|
5547
5481
|
autoplay: player.autoplay,
|
|
5548
5482
|
muted: player.muted,
|
|
5549
5483
|
gesture: 'media',
|
|
5550
|
-
playsinline:
|
|
5484
|
+
playsinline: player.config.playsinline,
|
|
5551
5485
|
// hash has to be added to iframe-URL
|
|
5552
5486
|
...hashParam,
|
|
5553
5487
|
...frameParams
|
|
@@ -5698,7 +5632,7 @@ const vimeo = {
|
|
|
5698
5632
|
},
|
|
5699
5633
|
set(input) {
|
|
5700
5634
|
const toggle = is.boolean(input) ? input : false;
|
|
5701
|
-
player.embed.
|
|
5635
|
+
player.embed.setMuted(toggle ? true : player.config.muted).then(() => {
|
|
5702
5636
|
muted = toggle;
|
|
5703
5637
|
triggerEvent.call(player, player.media, 'volumechange');
|
|
5704
5638
|
});
|
|
@@ -5971,7 +5905,7 @@ const youtube = {
|
|
|
5971
5905
|
const posterSrc = s => `https://i.ytimg.com/vi/${videoId}/${s}default.jpg`;
|
|
5972
5906
|
|
|
5973
5907
|
// Check thumbnail images in order of quality, but reject fallback thumbnails (120px wide)
|
|
5974
|
-
loadImage(posterSrc('maxres'), 121) //
|
|
5908
|
+
loadImage(posterSrc('maxres'), 121) // Highest quality and un-padded
|
|
5975
5909
|
.catch(() => loadImage(posterSrc('sd'), 121)) // 480p padded 4:3
|
|
5976
5910
|
.catch(() => loadImage(posterSrc('hq'))) // 360p padded 4:3. Always exists
|
|
5977
5911
|
.then(image => ui.setPoster.call(player, image.src)).then(src => {
|
|
@@ -5997,7 +5931,7 @@ const youtube = {
|
|
|
5997
5931
|
// Disable keyboard as we handle it
|
|
5998
5932
|
disablekb: 1,
|
|
5999
5933
|
// Allow iOS inline playback
|
|
6000
|
-
playsinline: !player.config.fullscreen.iosNative ? 1 : 0,
|
|
5934
|
+
playsinline: player.config.playsinline && !player.config.fullscreen.iosNative ? 1 : 0,
|
|
6001
5935
|
// Captions are flaky on YouTube
|
|
6002
5936
|
cc_load_policy: player.captions.active ? 1 : 0,
|
|
6003
5937
|
cc_lang_pref: player.config.captions.language,
|
|
@@ -6016,7 +5950,7 @@ const youtube = {
|
|
|
6016
5950
|
100: 'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.',
|
|
6017
5951
|
101: 'The owner of the requested video does not allow it to be played in embedded players.',
|
|
6018
5952
|
150: 'The owner of the requested video does not allow it to be played in embedded players.'
|
|
6019
|
-
}[code] || 'An unknown error
|
|
5953
|
+
}[code] || 'An unknown error occurred';
|
|
6020
5954
|
player.media.error = {
|
|
6021
5955
|
code,
|
|
6022
5956
|
message
|
|
@@ -6328,6 +6262,9 @@ class Ads {
|
|
|
6328
6262
|
* @return {Ads}
|
|
6329
6263
|
*/
|
|
6330
6264
|
constructor(player) {
|
|
6265
|
+
/**
|
|
6266
|
+
* Load the IMA SDK
|
|
6267
|
+
*/
|
|
6331
6268
|
_defineProperty$1(this, "load", () => {
|
|
6332
6269
|
if (!this.enabled) {
|
|
6333
6270
|
return;
|
|
@@ -6345,6 +6282,9 @@ class Ads {
|
|
|
6345
6282
|
this.ready();
|
|
6346
6283
|
}
|
|
6347
6284
|
});
|
|
6285
|
+
/**
|
|
6286
|
+
* Get the ads instance ready
|
|
6287
|
+
*/
|
|
6348
6288
|
_defineProperty$1(this, "ready", () => {
|
|
6349
6289
|
// Double check we're enabled
|
|
6350
6290
|
if (!this.enabled) {
|
|
@@ -6366,6 +6306,14 @@ class Ads {
|
|
|
6366
6306
|
// Setup the IMA SDK
|
|
6367
6307
|
this.setupIMA();
|
|
6368
6308
|
});
|
|
6309
|
+
/**
|
|
6310
|
+
* In order for the SDK to display ads for our video, we need to tell it where to put them,
|
|
6311
|
+
* so here we define our ad container. This div is set up to render on top of the video player.
|
|
6312
|
+
* Using the code below, we tell the SDK to render ads within that div. We also provide a
|
|
6313
|
+
* handle to the content video player - the SDK will poll the current time of our player to
|
|
6314
|
+
* properly place mid-rolls. After we create the ad display container, we initialize it. On
|
|
6315
|
+
* mobile devices, this initialization is done as the result of a user action.
|
|
6316
|
+
*/
|
|
6369
6317
|
_defineProperty$1(this, "setupIMA", () => {
|
|
6370
6318
|
// Create the container for our advertisements
|
|
6371
6319
|
this.elements.container = createElement('div', {
|
|
@@ -6395,6 +6343,9 @@ class Ads {
|
|
|
6395
6343
|
// Request video ads to be pre-loaded
|
|
6396
6344
|
this.requestAds();
|
|
6397
6345
|
});
|
|
6346
|
+
/**
|
|
6347
|
+
* Request advertisements
|
|
6348
|
+
*/
|
|
6398
6349
|
_defineProperty$1(this, "requestAds", () => {
|
|
6399
6350
|
const {
|
|
6400
6351
|
container
|
|
@@ -6421,6 +6372,10 @@ class Ads {
|
|
|
6421
6372
|
this.onAdError(error);
|
|
6422
6373
|
}
|
|
6423
6374
|
});
|
|
6375
|
+
/**
|
|
6376
|
+
* Update the ad countdown
|
|
6377
|
+
* @param {Boolean} start
|
|
6378
|
+
*/
|
|
6424
6379
|
_defineProperty$1(this, "pollCountdown", (start = false) => {
|
|
6425
6380
|
if (!start) {
|
|
6426
6381
|
clearInterval(this.countdownTimer);
|
|
@@ -6434,6 +6389,10 @@ class Ads {
|
|
|
6434
6389
|
};
|
|
6435
6390
|
this.countdownTimer = setInterval(update, 100);
|
|
6436
6391
|
});
|
|
6392
|
+
/**
|
|
6393
|
+
* This method is called whenever the ads are ready inside the AdDisplayContainer
|
|
6394
|
+
* @param {Event} event - adsManagerLoadedEvent
|
|
6395
|
+
*/
|
|
6437
6396
|
_defineProperty$1(this, "onAdsManagerLoaded", event => {
|
|
6438
6397
|
// Load could occur after a source change (race condition)
|
|
6439
6398
|
if (!this.enabled) {
|
|
@@ -6484,6 +6443,12 @@ class Ads {
|
|
|
6484
6443
|
});
|
|
6485
6444
|
}
|
|
6486
6445
|
});
|
|
6446
|
+
/**
|
|
6447
|
+
* This is where all the event handling takes place. Retrieve the ad from the event. Some
|
|
6448
|
+
* events (e.g. ALL_ADS_COMPLETED) don't have the ad object associated
|
|
6449
|
+
* https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdEvent.Type
|
|
6450
|
+
* @param {Event} event
|
|
6451
|
+
*/
|
|
6487
6452
|
_defineProperty$1(this, "onAdEvent", event => {
|
|
6488
6453
|
const {
|
|
6489
6454
|
container
|
|
@@ -6579,10 +6544,19 @@ class Ads {
|
|
|
6579
6544
|
break;
|
|
6580
6545
|
}
|
|
6581
6546
|
});
|
|
6547
|
+
/**
|
|
6548
|
+
* Any ad error handling comes through here
|
|
6549
|
+
* @param {Event} event
|
|
6550
|
+
*/
|
|
6582
6551
|
_defineProperty$1(this, "onAdError", event => {
|
|
6583
6552
|
this.cancel();
|
|
6584
6553
|
this.player.debug.warn('Ads error', event);
|
|
6585
6554
|
});
|
|
6555
|
+
/**
|
|
6556
|
+
* Setup hooks for Plyr and window events. This ensures
|
|
6557
|
+
* the mid- and post-roll launch at the correct time. And
|
|
6558
|
+
* resize the advertisement when the player resizes
|
|
6559
|
+
*/
|
|
6586
6560
|
_defineProperty$1(this, "listeners", () => {
|
|
6587
6561
|
const {
|
|
6588
6562
|
container
|
|
@@ -6618,6 +6592,9 @@ class Ads {
|
|
|
6618
6592
|
}
|
|
6619
6593
|
});
|
|
6620
6594
|
});
|
|
6595
|
+
/**
|
|
6596
|
+
* Initialize the adsManager and start playing advertisements
|
|
6597
|
+
*/
|
|
6621
6598
|
_defineProperty$1(this, "play", () => {
|
|
6622
6599
|
const {
|
|
6623
6600
|
container
|
|
@@ -6650,6 +6627,9 @@ class Ads {
|
|
|
6650
6627
|
}
|
|
6651
6628
|
}).catch(() => {});
|
|
6652
6629
|
});
|
|
6630
|
+
/**
|
|
6631
|
+
* Resume our video
|
|
6632
|
+
*/
|
|
6653
6633
|
_defineProperty$1(this, "resumeContent", () => {
|
|
6654
6634
|
// Hide the advertisement container
|
|
6655
6635
|
this.elements.container.style.zIndex = '';
|
|
@@ -6660,6 +6640,9 @@ class Ads {
|
|
|
6660
6640
|
// Play video
|
|
6661
6641
|
silencePromise(this.player.media.play());
|
|
6662
6642
|
});
|
|
6643
|
+
/**
|
|
6644
|
+
* Pause our video
|
|
6645
|
+
*/
|
|
6663
6646
|
_defineProperty$1(this, "pauseContent", () => {
|
|
6664
6647
|
// Show the advertisement container
|
|
6665
6648
|
this.elements.container.style.zIndex = 3;
|
|
@@ -6670,6 +6653,12 @@ class Ads {
|
|
|
6670
6653
|
// Pause our video.
|
|
6671
6654
|
this.player.media.pause();
|
|
6672
6655
|
});
|
|
6656
|
+
/**
|
|
6657
|
+
* Destroy the adsManager so we can grab new ads after this. If we don't then we're not
|
|
6658
|
+
* allowed to call new ads based on google policies, as they interpret this as an accidental
|
|
6659
|
+
* video requests. https://developers.google.com/interactive-
|
|
6660
|
+
* media-ads/docs/sdks/android/faq#8
|
|
6661
|
+
*/
|
|
6673
6662
|
_defineProperty$1(this, "cancel", () => {
|
|
6674
6663
|
// Pause our video
|
|
6675
6664
|
if (this.initialized) {
|
|
@@ -6682,6 +6671,9 @@ class Ads {
|
|
|
6682
6671
|
// Re-create our adsManager
|
|
6683
6672
|
this.loadAds();
|
|
6684
6673
|
});
|
|
6674
|
+
/**
|
|
6675
|
+
* Re-create our adsManager
|
|
6676
|
+
*/
|
|
6685
6677
|
_defineProperty$1(this, "loadAds", () => {
|
|
6686
6678
|
// Tell our adsManager to go bye bye
|
|
6687
6679
|
this.managerPromise.then(() => {
|
|
@@ -6702,6 +6694,11 @@ class Ads {
|
|
|
6702
6694
|
this.requestAds();
|
|
6703
6695
|
}).catch(() => {});
|
|
6704
6696
|
});
|
|
6697
|
+
/**
|
|
6698
|
+
* Handles callbacks after an ad event was invoked
|
|
6699
|
+
* @param {String} event - Event type
|
|
6700
|
+
* @param args
|
|
6701
|
+
*/
|
|
6705
6702
|
_defineProperty$1(this, "trigger", (event, ...args) => {
|
|
6706
6703
|
const handlers = this.events[event];
|
|
6707
6704
|
if (is.array(handlers)) {
|
|
@@ -6712,6 +6709,12 @@ class Ads {
|
|
|
6712
6709
|
});
|
|
6713
6710
|
}
|
|
6714
6711
|
});
|
|
6712
|
+
/**
|
|
6713
|
+
* Add event listeners
|
|
6714
|
+
* @param {String} event - Event type
|
|
6715
|
+
* @param {Function} callback - Callback for when event occurs
|
|
6716
|
+
* @return {Ads}
|
|
6717
|
+
*/
|
|
6715
6718
|
_defineProperty$1(this, "on", (event, callback) => {
|
|
6716
6719
|
if (!is.array(this.events[event])) {
|
|
6717
6720
|
this.events[event] = [];
|
|
@@ -6719,6 +6722,14 @@ class Ads {
|
|
|
6719
6722
|
this.events[event].push(callback);
|
|
6720
6723
|
return this;
|
|
6721
6724
|
});
|
|
6725
|
+
/**
|
|
6726
|
+
* Setup a safety timer for when the ad network doesn't respond for whatever reason.
|
|
6727
|
+
* The advertisement has 12 seconds to get its things together. We stop this timer when the
|
|
6728
|
+
* advertisement is playing, or when a user action is required to start, then we clear the
|
|
6729
|
+
* timer on ad ready
|
|
6730
|
+
* @param {Number} time
|
|
6731
|
+
* @param {String} from
|
|
6732
|
+
*/
|
|
6722
6733
|
_defineProperty$1(this, "startSafetyTimer", (time, from) => {
|
|
6723
6734
|
this.player.debug.log(`Safety timer invoked from: ${from}`);
|
|
6724
6735
|
this.safetyTimer = setTimeout(() => {
|
|
@@ -6726,6 +6737,10 @@ class Ads {
|
|
|
6726
6737
|
this.clearSafetyTimer('startSafetyTimer()');
|
|
6727
6738
|
}, time);
|
|
6728
6739
|
});
|
|
6740
|
+
/**
|
|
6741
|
+
* Clear our safety timer(s)
|
|
6742
|
+
* @param {String} from
|
|
6743
|
+
*/
|
|
6729
6744
|
_defineProperty$1(this, "clearSafetyTimer", from => {
|
|
6730
6745
|
if (!is.nullOrUndefined(this.safetyTimer)) {
|
|
6731
6746
|
this.player.debug.log(`Safety timer cleared from: ${from}`);
|
|
@@ -6764,11 +6779,6 @@ class Ads {
|
|
|
6764
6779
|
} = this;
|
|
6765
6780
|
return this.player.isHTML5 && this.player.isVideo && config.enabled && (!is.empty(config.publisherId) || is.url(config.tagUrl));
|
|
6766
6781
|
}
|
|
6767
|
-
|
|
6768
|
-
/**
|
|
6769
|
-
* Load the IMA SDK
|
|
6770
|
-
*/
|
|
6771
|
-
|
|
6772
6782
|
// Build the tag URL
|
|
6773
6783
|
get tagUrl() {
|
|
6774
6784
|
const {
|
|
@@ -6789,15 +6799,6 @@ class Ads {
|
|
|
6789
6799
|
const base = 'https://go.aniview.com/api/adserver6/vast/';
|
|
6790
6800
|
return `${base}?${buildUrlParams(params)}`;
|
|
6791
6801
|
}
|
|
6792
|
-
|
|
6793
|
-
/**
|
|
6794
|
-
* In order for the SDK to display ads for our video, we need to tell it where to put them,
|
|
6795
|
-
* so here we define our ad container. This div is set up to render on top of the video player.
|
|
6796
|
-
* Using the code below, we tell the SDK to render ads within that div. We also provide a
|
|
6797
|
-
* handle to the content video player - the SDK will poll the current time of our player to
|
|
6798
|
-
* properly place mid-rolls. After we create the ad display container, we initialize it. On
|
|
6799
|
-
* mobile devices, this initialization is done as the result of a user action.
|
|
6800
|
-
*/
|
|
6801
6802
|
}
|
|
6802
6803
|
|
|
6803
6804
|
/**
|
|
@@ -6896,9 +6897,13 @@ class PreviewThumbnails {
|
|
|
6896
6897
|
|
|
6897
6898
|
// Check to see if thumb container size was specified manually in CSS
|
|
6898
6899
|
this.determineContainerAutoSizing();
|
|
6900
|
+
|
|
6901
|
+
// Set up listeners
|
|
6902
|
+
this.listeners();
|
|
6899
6903
|
this.loaded = true;
|
|
6900
6904
|
});
|
|
6901
6905
|
});
|
|
6906
|
+
// Download VTT files and parse them
|
|
6902
6907
|
_defineProperty$1(this, "getThumbnails", () => {
|
|
6903
6908
|
return new Promise(resolve => {
|
|
6904
6909
|
const {
|
|
@@ -6934,6 +6939,7 @@ class PreviewThumbnails {
|
|
|
6934
6939
|
}
|
|
6935
6940
|
});
|
|
6936
6941
|
});
|
|
6942
|
+
// Process individual VTT file
|
|
6937
6943
|
_defineProperty$1(this, "getThumbnail", url => {
|
|
6938
6944
|
return new Promise(resolve => {
|
|
6939
6945
|
fetch(url).then(response => {
|
|
@@ -7040,6 +7046,9 @@ class PreviewThumbnails {
|
|
|
7040
7046
|
});
|
|
7041
7047
|
}
|
|
7042
7048
|
});
|
|
7049
|
+
/**
|
|
7050
|
+
* Setup hooks for Plyr and window events
|
|
7051
|
+
*/
|
|
7043
7052
|
_defineProperty$1(this, "listeners", () => {
|
|
7044
7053
|
// Hide thumbnail preview - on mouse click, mouse leave (in listeners.js for now), and video play/seek. All four are required, e.g., for buffering
|
|
7045
7054
|
this.player.on('play', () => {
|
|
@@ -7052,6 +7061,9 @@ class PreviewThumbnails {
|
|
|
7052
7061
|
this.lastTime = this.player.media.currentTime;
|
|
7053
7062
|
});
|
|
7054
7063
|
});
|
|
7064
|
+
/**
|
|
7065
|
+
* Create HTML elements for image containers
|
|
7066
|
+
*/
|
|
7055
7067
|
_defineProperty$1(this, "render", () => {
|
|
7056
7068
|
// Create HTML element: plyr__preview-thumbnail-container
|
|
7057
7069
|
this.elements.thumb.container = createElement('div', {
|
|
@@ -7127,6 +7139,7 @@ class PreviewThumbnails {
|
|
|
7127
7139
|
this.loadImage(qualityIndex);
|
|
7128
7140
|
}
|
|
7129
7141
|
});
|
|
7142
|
+
// Show the image that's currently specified in this.showingThumb
|
|
7130
7143
|
_defineProperty$1(this, "loadImage", (qualityIndex = 0) => {
|
|
7131
7144
|
const thumbNum = this.showingThumb;
|
|
7132
7145
|
const thumbnail = this.thumbnails[qualityIndex];
|
|
@@ -7180,6 +7193,7 @@ class PreviewThumbnails {
|
|
|
7180
7193
|
// Each step here has a short time delay, and only continues if still hovering/seeking the same spot. This is to protect slow connections from overloading
|
|
7181
7194
|
this.preloadNearby(thumbNum, true).then(this.preloadNearby(thumbNum, false)).then(this.getHigherQuality(qualityIndex, previewImage, frame, thumbFilename));
|
|
7182
7195
|
});
|
|
7196
|
+
// Remove all preview images that aren't the designated current image
|
|
7183
7197
|
_defineProperty$1(this, "removeOldImages", currentImage => {
|
|
7184
7198
|
// Get a list of all images, convert it from a DOM list to an array
|
|
7185
7199
|
Array.from(this.currentImageContainer.children).forEach(image => {
|
|
@@ -7204,6 +7218,8 @@ class PreviewThumbnails {
|
|
|
7204
7218
|
}
|
|
7205
7219
|
});
|
|
7206
7220
|
});
|
|
7221
|
+
// Preload images before and after the current one. Only if the user is still hovering/seeking the same frame
|
|
7222
|
+
// This will only preload the lowest quality
|
|
7207
7223
|
_defineProperty$1(this, "preloadNearby", (thumbNum, forward = true) => {
|
|
7208
7224
|
return new Promise(resolve => {
|
|
7209
7225
|
setTimeout(() => {
|
|
@@ -7249,6 +7265,7 @@ class PreviewThumbnails {
|
|
|
7249
7265
|
}, 300);
|
|
7250
7266
|
});
|
|
7251
7267
|
});
|
|
7268
|
+
// If user has been hovering current image for half a second, look for a higher quality one
|
|
7252
7269
|
_defineProperty$1(this, "getHigherQuality", (currentQualityIndex, previewImage, frame, thumbFilename) => {
|
|
7253
7270
|
if (currentQualityIndex < this.thumbnails.length - 1) {
|
|
7254
7271
|
// Only use the higher quality version if it's going to look any better - if the current thumb is of a lower pixel density than the thumbnail container
|
|
@@ -7290,6 +7307,7 @@ class PreviewThumbnails {
|
|
|
7290
7307
|
this.sizeSpecifiedInCSS = true;
|
|
7291
7308
|
}
|
|
7292
7309
|
});
|
|
7310
|
+
// Set the size to be about a quarter of the size of video. Unless option dynamicSize === false, in which case it needs to be set in CSS
|
|
7293
7311
|
_defineProperty$1(this, "setThumbContainerSizeAndPos", () => {
|
|
7294
7312
|
const {
|
|
7295
7313
|
imageContainer
|
|
@@ -7326,6 +7344,7 @@ class PreviewThumbnails {
|
|
|
7326
7344
|
// The arrow can follow the cursor
|
|
7327
7345
|
container.style.setProperty('--preview-arrow-offset', `${position - clamped}px`);
|
|
7328
7346
|
});
|
|
7347
|
+
// Can't use 100% width, in case the video is a different aspect ratio to the video container
|
|
7329
7348
|
_defineProperty$1(this, "setScrubbingContainerSize", () => {
|
|
7330
7349
|
const {
|
|
7331
7350
|
width,
|
|
@@ -7337,6 +7356,7 @@ class PreviewThumbnails {
|
|
|
7337
7356
|
this.elements.scrubbing.container.style.width = `${width}px`;
|
|
7338
7357
|
this.elements.scrubbing.container.style.height = `${height}px`;
|
|
7339
7358
|
});
|
|
7359
|
+
// Sprites need to be offset to the correct location
|
|
7340
7360
|
_defineProperty$1(this, "setImageSizeAndOffset", (previewImage, frame) => {
|
|
7341
7361
|
if (!this.usingSprites) return;
|
|
7342
7362
|
|
|
@@ -7561,6 +7581,9 @@ const source = {
|
|
|
7561
7581
|
// Plyr instance
|
|
7562
7582
|
class Plyr {
|
|
7563
7583
|
constructor(target, options) {
|
|
7584
|
+
/**
|
|
7585
|
+
* Play the media, or play the advertisement (if they are not blocked)
|
|
7586
|
+
*/
|
|
7564
7587
|
_defineProperty$1(this, "play", () => {
|
|
7565
7588
|
if (!is.function(this.media.play)) {
|
|
7566
7589
|
return null;
|
|
@@ -7574,12 +7597,19 @@ class Plyr {
|
|
|
7574
7597
|
// Return the promise (for HTML5)
|
|
7575
7598
|
return this.media.play();
|
|
7576
7599
|
});
|
|
7600
|
+
/**
|
|
7601
|
+
* Pause the media
|
|
7602
|
+
*/
|
|
7577
7603
|
_defineProperty$1(this, "pause", () => {
|
|
7578
7604
|
if (!this.playing || !is.function(this.media.pause)) {
|
|
7579
7605
|
return null;
|
|
7580
7606
|
}
|
|
7581
7607
|
return this.media.pause();
|
|
7582
7608
|
});
|
|
7609
|
+
/**
|
|
7610
|
+
* Toggle playback based on current status
|
|
7611
|
+
* @param {Boolean} input
|
|
7612
|
+
*/
|
|
7583
7613
|
_defineProperty$1(this, "togglePlay", input => {
|
|
7584
7614
|
// Toggle based on current state if nothing passed
|
|
7585
7615
|
const toggle = is.boolean(input) ? input : !this.playing;
|
|
@@ -7588,6 +7618,9 @@ class Plyr {
|
|
|
7588
7618
|
}
|
|
7589
7619
|
return this.pause();
|
|
7590
7620
|
});
|
|
7621
|
+
/**
|
|
7622
|
+
* Stop playback
|
|
7623
|
+
*/
|
|
7591
7624
|
_defineProperty$1(this, "stop", () => {
|
|
7592
7625
|
if (this.isHTML5) {
|
|
7593
7626
|
this.pause();
|
|
@@ -7596,28 +7629,55 @@ class Plyr {
|
|
|
7596
7629
|
this.media.stop();
|
|
7597
7630
|
}
|
|
7598
7631
|
});
|
|
7632
|
+
/**
|
|
7633
|
+
* Restart playback
|
|
7634
|
+
*/
|
|
7599
7635
|
_defineProperty$1(this, "restart", () => {
|
|
7600
7636
|
this.currentTime = 0;
|
|
7601
7637
|
});
|
|
7638
|
+
/**
|
|
7639
|
+
* Rewind
|
|
7640
|
+
* @param {Number} seekTime - how far to rewind in seconds. Defaults to the config.seekTime
|
|
7641
|
+
*/
|
|
7602
7642
|
_defineProperty$1(this, "rewind", seekTime => {
|
|
7603
7643
|
this.currentTime -= is.number(seekTime) ? seekTime : this.config.seekTime;
|
|
7604
7644
|
});
|
|
7645
|
+
/**
|
|
7646
|
+
* Fast forward
|
|
7647
|
+
* @param {Number} seekTime - how far to fast forward in seconds. Defaults to the config.seekTime
|
|
7648
|
+
*/
|
|
7605
7649
|
_defineProperty$1(this, "forward", seekTime => {
|
|
7606
7650
|
this.currentTime += is.number(seekTime) ? seekTime : this.config.seekTime;
|
|
7607
7651
|
});
|
|
7652
|
+
/**
|
|
7653
|
+
* Increase volume
|
|
7654
|
+
* @param {Boolean} step - How much to decrease by (between 0 and 1)
|
|
7655
|
+
*/
|
|
7608
7656
|
_defineProperty$1(this, "increaseVolume", step => {
|
|
7609
7657
|
const volume = this.media.muted ? 0 : this.volume;
|
|
7610
7658
|
this.volume = volume + (is.number(step) ? step : 0);
|
|
7611
7659
|
});
|
|
7660
|
+
/**
|
|
7661
|
+
* Decrease volume
|
|
7662
|
+
* @param {Boolean} step - How much to decrease by (between 0 and 1)
|
|
7663
|
+
*/
|
|
7612
7664
|
_defineProperty$1(this, "decreaseVolume", step => {
|
|
7613
7665
|
this.increaseVolume(-step);
|
|
7614
7666
|
});
|
|
7667
|
+
/**
|
|
7668
|
+
* Trigger the airplay dialog
|
|
7669
|
+
* TODO: update player with state, support, enabled
|
|
7670
|
+
*/
|
|
7615
7671
|
_defineProperty$1(this, "airplay", () => {
|
|
7616
7672
|
// Show dialog if supported
|
|
7617
7673
|
if (support.airplay) {
|
|
7618
7674
|
this.media.webkitShowPlaybackTargetPicker();
|
|
7619
7675
|
}
|
|
7620
7676
|
});
|
|
7677
|
+
/**
|
|
7678
|
+
* Toggle the player controls
|
|
7679
|
+
* @param {Boolean} [toggle] - Whether to show the controls
|
|
7680
|
+
*/
|
|
7621
7681
|
_defineProperty$1(this, "toggleControls", toggle => {
|
|
7622
7682
|
// Don't toggle if missing UI support or if it's audio
|
|
7623
7683
|
if (this.supported.ui && !this.isAudio) {
|
|
@@ -7642,15 +7702,37 @@ class Plyr {
|
|
|
7642
7702
|
}
|
|
7643
7703
|
return false;
|
|
7644
7704
|
});
|
|
7705
|
+
/**
|
|
7706
|
+
* Add event listeners
|
|
7707
|
+
* @param {String} event - Event type
|
|
7708
|
+
* @param {Function} callback - Callback for when event occurs
|
|
7709
|
+
*/
|
|
7645
7710
|
_defineProperty$1(this, "on", (event, callback) => {
|
|
7646
7711
|
on.call(this, this.elements.container, event, callback);
|
|
7647
7712
|
});
|
|
7713
|
+
/**
|
|
7714
|
+
* Add event listeners once
|
|
7715
|
+
* @param {String} event - Event type
|
|
7716
|
+
* @param {Function} callback - Callback for when event occurs
|
|
7717
|
+
*/
|
|
7648
7718
|
_defineProperty$1(this, "once", (event, callback) => {
|
|
7649
7719
|
once.call(this, this.elements.container, event, callback);
|
|
7650
7720
|
});
|
|
7721
|
+
/**
|
|
7722
|
+
* Remove event listeners
|
|
7723
|
+
* @param {String} event - Event type
|
|
7724
|
+
* @param {Function} callback - Callback for when event occurs
|
|
7725
|
+
*/
|
|
7651
7726
|
_defineProperty$1(this, "off", (event, callback) => {
|
|
7652
7727
|
off(this.elements.container, event, callback);
|
|
7653
7728
|
});
|
|
7729
|
+
/**
|
|
7730
|
+
* Destroy an instance
|
|
7731
|
+
* Event listeners are removed when elements are removed
|
|
7732
|
+
* http://stackoverflow.com/questions/12528049/if-a-dom-element-is-removed-are-its-listeners-also-removed-from-memory
|
|
7733
|
+
* @param {Function} callback - Callback for when destroy is complete
|
|
7734
|
+
* @param {Boolean} soft - Whether it's a soft destroy (for source changes etc)
|
|
7735
|
+
*/
|
|
7654
7736
|
_defineProperty$1(this, "destroy", (callback, soft = false) => {
|
|
7655
7737
|
if (!this.ready) {
|
|
7656
7738
|
return;
|
|
@@ -7749,6 +7831,10 @@ class Plyr {
|
|
|
7749
7831
|
setTimeout(done, 200);
|
|
7750
7832
|
}
|
|
7751
7833
|
});
|
|
7834
|
+
/**
|
|
7835
|
+
* Check for support for a mime type (HTML5 only)
|
|
7836
|
+
* @param {String} type - Mime type
|
|
7837
|
+
*/
|
|
7752
7838
|
_defineProperty$1(this, "supports", type => support.mime.call(this, type));
|
|
7753
7839
|
this.timers = {};
|
|
7754
7840
|
|
|
@@ -7946,7 +8032,7 @@ class Plyr {
|
|
|
7946
8032
|
}
|
|
7947
8033
|
|
|
7948
8034
|
// Check for support again but with type
|
|
7949
|
-
this.supported = support.check(this.type, this.provider
|
|
8035
|
+
this.supported = support.check(this.type, this.provider);
|
|
7950
8036
|
|
|
7951
8037
|
// If no support for even API, bail
|
|
7952
8038
|
if (!this.supported.api) {
|
|
@@ -7966,9 +8052,7 @@ class Plyr {
|
|
|
7966
8052
|
|
|
7967
8053
|
// Wrap media
|
|
7968
8054
|
if (!is.element(this.elements.container)) {
|
|
7969
|
-
this.elements.container = createElement('div'
|
|
7970
|
-
tabindex: 0
|
|
7971
|
-
});
|
|
8055
|
+
this.elements.container = createElement('div');
|
|
7972
8056
|
wrap(this.media, this.elements.container);
|
|
7973
8057
|
}
|
|
7974
8058
|
|
|
@@ -8047,11 +8131,6 @@ class Plyr {
|
|
|
8047
8131
|
get isAudio() {
|
|
8048
8132
|
return this.type === types.audio;
|
|
8049
8133
|
}
|
|
8050
|
-
|
|
8051
|
-
/**
|
|
8052
|
-
* Play the media, or play the advertisement (if they are not blocked)
|
|
8053
|
-
*/
|
|
8054
|
-
|
|
8055
8134
|
/**
|
|
8056
8135
|
* Get playing state
|
|
8057
8136
|
*/
|
|
@@ -8079,12 +8158,6 @@ class Plyr {
|
|
|
8079
8158
|
get ended() {
|
|
8080
8159
|
return Boolean(this.media.ended);
|
|
8081
8160
|
}
|
|
8082
|
-
|
|
8083
|
-
/**
|
|
8084
|
-
* Toggle playback based on current status
|
|
8085
|
-
* @param {Boolean} input
|
|
8086
|
-
*/
|
|
8087
|
-
|
|
8088
8161
|
/**
|
|
8089
8162
|
* Seek to a time
|
|
8090
8163
|
* @param {Number} input - where to seek to in seconds. Defaults to 0 (the start)
|
|
@@ -8206,12 +8279,6 @@ class Plyr {
|
|
|
8206
8279
|
get volume() {
|
|
8207
8280
|
return Number(this.media.volume);
|
|
8208
8281
|
}
|
|
8209
|
-
|
|
8210
|
-
/**
|
|
8211
|
-
* Increase volume
|
|
8212
|
-
* @param {Boolean} step - How much to decrease by (between 0 and 1)
|
|
8213
|
-
*/
|
|
8214
|
-
|
|
8215
8282
|
/**
|
|
8216
8283
|
* Set muted state
|
|
8217
8284
|
* @param {Boolean} mute
|
|
@@ -8625,7 +8692,7 @@ class Plyr {
|
|
|
8625
8692
|
}
|
|
8626
8693
|
|
|
8627
8694
|
/**
|
|
8628
|
-
* Sets the preview
|
|
8695
|
+
* Sets the preview thumbnails for the current source
|
|
8629
8696
|
*/
|
|
8630
8697
|
setPreviewThumbnails(thumbnailSource) {
|
|
8631
8698
|
if (this.previewThumbnails && this.previewThumbnails.loaded) {
|
|
@@ -8639,20 +8706,13 @@ class Plyr {
|
|
|
8639
8706
|
this.previewThumbnails = new PreviewThumbnails(this);
|
|
8640
8707
|
}
|
|
8641
8708
|
}
|
|
8642
|
-
|
|
8643
|
-
/**
|
|
8644
|
-
* Trigger the airplay dialog
|
|
8645
|
-
* TODO: update player with state, support, enabled
|
|
8646
|
-
*/
|
|
8647
|
-
|
|
8648
8709
|
/**
|
|
8649
8710
|
* Check for support
|
|
8650
8711
|
* @param {String} type - Player type (audio/video)
|
|
8651
8712
|
* @param {String} provider - Provider (html5/youtube/vimeo)
|
|
8652
|
-
* @param {Boolean} inline - Where player has `playsinline` sttribute
|
|
8653
8713
|
*/
|
|
8654
|
-
static supported(type, provider
|
|
8655
|
-
return support.check(type, provider
|
|
8714
|
+
static supported(type, provider) {
|
|
8715
|
+
return support.check(type, provider);
|
|
8656
8716
|
}
|
|
8657
8717
|
|
|
8658
8718
|
/**
|