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.3.x

Co-authored-by: Joey Parrish <[email protected]>
  • Loading branch information
ocipap and joeyparrish committed Nov 9, 2022
1 parent 6804c6a commit b7a841d
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 @@ -1004,7 +1004,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 b7a841d

Please sign in to comment.