Skip to content

Commit

Permalink
fix(ui): Fix exception on screen rotation if fullscreen is not suppor…
Browse files Browse the repository at this point in the history
…ted (#4669)

If fullscreen is not supported when enableFullscreenOnRotation option is enabled, this exception occurred:

TypeError: i.j.requestFullscreen is not a function. (In 'i.j.requestFullscreen({navigationUI:"hide"})', 'i.j.requestFullscreen' is undefined)

This fixes the exception by checking isFullScreenSupported().

Backported to v3.2.x

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
  • Loading branch information
ocipap and joeyparrish committed Nov 9, 2022
1 parent 8440e01 commit cbefdb8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,10 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
if (!this.video_ ||
this.video_.readyState == 0 ||
this.castProxy_.isCasting() ||
!this.config_.enableFullscreenOnRotation) { return; }
!this.config_.enableFullscreenOnRotation ||
!document.fullscreenEnabled) {
return;
}

if (screen.orientation.type.includes('landscape') &&
!document.fullscreenElement) {
Expand Down

0 comments on commit cbefdb8

Please sign in to comment.