Skip to content

Commit

Permalink
fix: Ensures iOS can use native fullscreen (#8071)
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben authored Jan 24, 2023
1 parent 3accbc7 commit 509b3d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

/**
Expand Down
12 changes: 12 additions & 0 deletions test/unit/tech/html5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

0 comments on commit 509b3d0

Please sign in to comment.