1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-08 07:00:10 +02:00

fix(player): silence rejected fullscreen promise (#5970)

The fullscreen API now returns a promise. If the player is inside an
iframe that doesn't allow fullscreen, the promise will reject and cause
an error to be logged. Instead, we should silence this promise.

Fixes #5918
This commit is contained in:
Gary Katsevman 2019-04-29 15:13:56 -04:00 committed by GitHub
parent 1eb47f0690
commit 4585c08bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2684,7 +2684,7 @@ class Player extends Component {
// events
Events.on(document, fsApi.fullscreenchange, this.boundDocumentFullscreenChange_);
this.el_[fsApi.requestFullscreen]();
silencePromise(this.el_[fsApi.requestFullscreen]());
} else if (this.tech_.supportsFullScreen()) {
// we can't take the video.js controls fullscreen but we can go fullscreen
@ -2714,7 +2714,7 @@ class Player extends Component {
// Check for browser element fullscreen support
if (fsApi.requestFullscreen) {
document[fsApi.exitFullscreen]();
silencePromise(document[fsApi.exitFullscreen]());
} else if (this.tech_.supportsFullScreen()) {
this.techCall_('exitFullScreen');
} else {