From 4585c08bdba38dc685326a6040893fb6a40c80d9 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Mon, 29 Apr 2019 15:13:56 -0400 Subject: [PATCH] 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 --- src/js/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index d4b03a9ed..7906f095f 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -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 {