1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-25 02:42:10 +02:00

fix: Ensures iOS can use native fullscreen (#8071)

This commit is contained in:
mister-ben 2023-01-24 11:45:49 +01:00 committed by GitHub
parent 3accbc7c73
commit 509b3d0757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -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';
}
/**

View File

@ -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;
});