aboutsummaryrefslogtreecommitdiffstats
path: root/demo/dist/demo.js
diff options
context:
space:
mode:
Diffstat (limited to 'demo/dist/demo.js')
-rw-r--r--demo/dist/demo.js63
1 files changed, 53 insertions, 10 deletions
diff --git a/demo/dist/demo.js b/demo/dist/demo.js
index 8c8b4152..e2d8f3ea 100644
--- a/demo/dist/demo.js
+++ b/demo/dist/demo.js
@@ -17736,6 +17736,25 @@ typeof navigator === "object" && (function () {
var method = prototype.matches || prototype.webkitMatchesSelector || prototype.mozMatchesSelector || prototype.msMatchesSelector || match;
return method.call(element, selector);
+ } // Closest ancestor element matching selector (also tests element itself)
+
+ function closest(element, selector) {
+ var _Element2 = Element,
+ prototype = _Element2.prototype; // https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill
+
+ function closestElement() {
+ var el = this;
+
+ do {
+ if (matches$2.matches(el, selector)) return el;
+ el = el.parentElement || el.parentNode;
+ } while (el !== null && el.nodeType === 1);
+
+ return null;
+ }
+
+ var method = prototype.closest || closestElement;
+ return method.call(element, selector);
} // Find all elements
function getElements(selector) {
@@ -18241,7 +18260,7 @@ typeof navigator === "object" && (function () {
});
} // Get the closest value in an array
- function closest(array, value) {
+ function closest$1(array, value) {
if (!is$2.array(array) || !array.length) {
return null;
}
@@ -20704,6 +20723,9 @@ typeof navigator === "object" && (function () {
fallback: true,
// Fallback using full viewport/window
iosNative: false // Use the native fullscreen in iOS (disables custom controls)
+ // Selector for the fullscreen container so contextual / non-player content can remain visible in fullscreen mode
+ // Non-ancestors of the player element will be ignored
+ // container: null, // defaults to the player element
},
// Local storage
@@ -21060,7 +21082,10 @@ typeof navigator === "object" && (function () {
y: 0
}; // Force the use of 'full window/browser' rather than fullscreen
- this.forceFallback = player.config.fullscreen.fallback === 'force'; // Register event listeners
+ this.forceFallback = player.config.fullscreen.fallback === 'force'; // Get the fullscreen element
+ // Checks container is an ancestor, defaults to null
+
+ this.player.elements.fullscreen = player.config.fullscreen.container && closest(this.player.elements.container, player.config.fullscreen.container); // Register event listeners
// Handle event (incase user presses escape etc)
on.call(this.player, document, this.prefix === 'ms' ? 'MSFullscreenChange' : "".concat(this.prefix, "fullscreenchange"), function () {
@@ -21286,7 +21311,7 @@ typeof navigator === "object" && (function () {
}, {
key: "target",
get: function get() {
- return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.container;
+ return browser.isIos && this.player.config.fullscreen.iosNative ? this.player.media : this.player.elements.fullscreen || this.player.elements.container;
}
}], [{
key: "native",
@@ -22289,7 +22314,18 @@ typeof navigator === "object" && (function () {
this.bind(elements.controls, 'mouseenter mouseleave', function (event) {
elements.controls.hover = !player.touch && event.type === 'mouseenter';
- }); // Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting)
+ }); // Also update controls.hover state for any non-player children of fullscreen element (as above)
+
+ if (elements.fullscreen) {
+ for (var i = 0; i < elements.fullscreen.children.length; i++) {
+ if (!elements.fullscreen.children[i].contains(elements.container)) {
+ this.bind(elements.fullscreen.children[i], 'mouseenter mouseleave', function (event) {
+ elements.controls.hover = !player.touch && event.type === 'mouseenter';
+ });
+ }
+ }
+ } // Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting)
+
this.bind(elements.controls, 'mousedown mouseup touchstart touchend touchcancel', function (event) {
elements.controls.pressed = ['mousedown', 'touchstart'].includes(event.type);
@@ -25148,6 +25184,7 @@ typeof navigator === "object" && (function () {
this.elements = {
container: null,
+ fullscreen: null,
captions: null,
buttons: {},
display: {},
@@ -25333,10 +25370,12 @@ typeof navigator === "object" && (function () {
on.call(this, this.elements.container, this.config.events.join(' '), function (event) {
_this.debug.log("event: ".concat(event.type));
});
- } // Setup interface
- // If embed but not fully supported, build interface now to avoid flash of controls
+ } // Setup fullscreen
+ this.fullscreen = new Fullscreen(this); // Setup interface
+ // If embed but not fully supported, build interface now to avoid flash of controls
+
if (this.isHTML5 || this.isEmbed && !this.supported.ui) {
ui.build.call(this);
} // Container listeners
@@ -25344,9 +25383,7 @@ typeof navigator === "object" && (function () {
this.listeners.container(); // Global listeners
- this.listeners.global(); // Setup fullscreen
-
- this.fullscreen = new Fullscreen(this); // Setup ads if provided
+ this.listeners.global(); // Setup ads if provided
if (this.config.ads.enabled) {
this.ads = new Ads(this);
@@ -26045,7 +26082,7 @@ typeof navigator === "object" && (function () {
var updateStorage = true;
if (!options.includes(quality)) {
- var value = closest(options, quality);
+ var value = closest$1(options, quality);
this.debug.warn("Unsupported quality option: ".concat(quality, ", using ").concat(value, " instead"));
quality = value; // Don't update storage if quality is not supported
@@ -26486,6 +26523,12 @@ typeof navigator === "object" && (function () {
vimeo: {
// Prevent Vimeo blocking plyr.io demo site
referrerPolicy: 'no-referrer'
+ },
+ fullscreen: {
+ enabled: true,
+ fallback: true,
+ iosNative: false,
+ container: '#container'
}
}); // Expose for tinkering in the console