From d6b07f089e78cd258edcb192b0992d2c92674b88 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Thu, 28 May 2020 10:29:36 -0400 Subject: [PATCH] fix(fs): don't set player element css props on native fullscreen (#6673) Fixes #6640 --- src/css/components/_layout.scss | 3 ++- src/js/player.js | 3 +++ src/js/tech/html5.js | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/css/components/_layout.scss b/src/css/components/_layout.scss index 0d92b9026..34409f67b 100644 --- a/src/css/components/_layout.scss +++ b/src/css/components/_layout.scss @@ -113,12 +113,13 @@ body.vjs-full-window { bottom: 0; right: 0; } -.video-js.vjs-fullscreen { +.video-js.vjs-fullscreen:not(.vjs-ios-native-fs) { width: 100% !important; height: 100% !important; // Undo any aspect ratio padding for fluid layouts padding-top: 0 !important; } + .video-js.vjs-fullscreen.vjs-user-inactive { cursor: none; } diff --git a/src/js/player.js b/src/js/player.js index e811643b4..9b6391613 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2077,6 +2077,9 @@ class Player extends Component { */ handleTechFullscreenChange_(event, data) { if (data) { + if (data.nativeIOSFullscreen) { + this.toggleClass('vjs-ios-native-fs'); + } this.isFullscreen(data.isFullscreen); } } diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index 4a6b7ac8f..cffcf1742 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -626,7 +626,11 @@ class Html5 extends Tech { this.el_.webkitPresentationMode !== 'picture-in-picture') { this.one('webkitendfullscreen', endFn); - this.trigger('fullscreenchange', { isFullscreen: true }); + this.trigger('fullscreenchange', { + isFullscreen: true, + // set a flag in case another tech triggers fullscreenchange + nativeIOSFullscreen: true + }); } };