Skip to content

Commit b7a841d

Browse files
ocipapjoeyparrish
andcommitted
fix(ui): Fix exception on screen rotation if fullscreen is not supported (#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 <joeyparrish@users.noreply.github.com>
1 parent 6804c6a commit b7a841d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/controls.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,10 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
10041004
if (!this.video_ ||
10051005
this.video_.readyState == 0 ||
10061006
this.castProxy_.isCasting() ||
1007-
!this.config_.enableFullscreenOnRotation) { return; }
1007+
!this.config_.enableFullscreenOnRotation ||
1008+
!document.fullscreenEnabled) {
1009+
return;
1010+
}
10081011

10091012
if (screen.orientation.type.includes('landscape') &&
10101013
!document.fullscreenElement) {

0 commit comments

Comments
 (0)