From 509b3d075750be689ded67ca887d70af578c7804 Mon Sep 17 00:00:00 2001 From: mister-ben Date: Tue, 24 Jan 2023 11:45:49 +0100 Subject: [PATCH] fix: Ensures iOS can use native fullscreen (#8071) --- src/js/tech/html5.js | 10 ++-------- test/unit/tech/html5.test.js | 12 ++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index b646f9a129..3201d15603 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -666,20 +666,14 @@ class Html5 extends Tech { } /** - * Check if fullscreen is supported on the current playback device. + * Check if fullscreen is supported on the video el. * * @return {boolean} * - True if fullscreen is supported. * - False if fullscreen is not supported. */ supportsFullScreen() { - if (typeof this.el_.webkitEnterFullScreen === 'function') { - // Still needed? - if (browser.IS_ANDROID) { - return true; - } - } - return false; + return typeof this.el_.webkitEnterFullScreen === 'function'; } /** diff --git a/test/unit/tech/html5.test.js b/test/unit/tech/html5.test.js index 53e1b42a63..e90e305dff 100644 --- a/test/unit/tech/html5.test.js +++ b/test/unit/tech/html5.test.js @@ -893,3 +893,15 @@ QUnit.test('featuresVideoFrameCallback is false for Safari DRM', function(assert assert.ok(true, 'skipped because webkitKeys not writable'); } }); + +QUnit.test('supportsFullScreen is always with `webkitEnterFullScreen`', function(assert) { + const oldEl = tech.el_; + + tech.el_ = { + webkitEnterFullScreen: () => {} + }; + + assert.ok(tech.supportsFullScreen(), 'supportsFullScreen() true with webkitEnterFullScreen'); + + tech.el_ = oldEl; +});