Skip to content

Commit 6c54db9

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(). Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
1 parent 731bd96 commit 6c54db9

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
@@ -1024,7 +1024,10 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
10241024
if (!this.video_ ||
10251025
this.video_.readyState == 0 ||
10261026
this.castProxy_.isCasting() ||
1027-
!this.config_.enableFullscreenOnRotation) { return; }
1027+
!this.config_.enableFullscreenOnRotation ||
1028+
!this.isFullScreenSupported()) {
1029+
return;
1030+
}
10281031

10291032
if (screen.orientation.type.includes('landscape') &&
10301033
!document.fullscreenElement) {

0 commit comments

Comments
 (0)