aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/fullscreen.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-03-29 12:02:59 +1100
committerSam Potts <sam@potts.es>2020-03-29 12:02:59 +1100
commit09598f07bf062886bfa22cd8682948567e92a19a (patch)
tree2ed0de186d43b2cc27422115fe75600a12e5d303 /src/js/fullscreen.js
parentef7b30c1b8a0e2d9a8cb71dfb41af0706bb8886e (diff)
parent155add66bd5b941699cea99f5c94cf8a87b030d8 (diff)
downloadplyr-09598f07bf062886bfa22cd8682948567e92a19a.tar.lz
plyr-09598f07bf062886bfa22cd8682948567e92a19a.tar.xz
plyr-09598f07bf062886bfa22cd8682948567e92a19a.zip
Merge branch 'develop' of github.com:sampotts/plyr into develop
# Conflicts: # package.json # yarn.lock
Diffstat (limited to 'src/js/fullscreen.js')
-rw-r--r--src/js/fullscreen.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/js/fullscreen.js b/src/js/fullscreen.js
index c74b3406..4d3c89ac 100644
--- a/src/js/fullscreen.js
+++ b/src/js/fullscreen.js
@@ -8,6 +8,7 @@ import browser from './utils/browser';
import { getElements, hasClass, toggleClass } from './utils/elements';
import { on, triggerEvent } from './utils/events';
import is from './utils/is';
+import { silencePromise } from './utils/promise';
class Fullscreen {
constructor(player) {
@@ -118,7 +119,7 @@ class Fullscreen {
const element = !this.prefix ? document.fullscreenElement : document[`${this.prefix}${this.property}Element`];
- return element === this.target;
+ return element && element.shadowRoot ? element === this.target.getRootNode().host : element === this.target;
}
// Get target element
@@ -268,7 +269,7 @@ class Fullscreen {
// iOS native fullscreen
if (browser.isIos && this.player.config.fullscreen.iosNative) {
this.target.webkitExitFullscreen();
- this.player.play();
+ silencePromise(this.player.play());
} else if (!Fullscreen.native || this.forceFallback) {
this.toggleFallback(false);
} else if (!this.prefix) {