Skip to content

Commit

Permalink
Fix (UI): Check fullscreenEnabled in dblclick
Browse files Browse the repository at this point in the history
Our "double tap on the video to enter fullscreen" functionality was
not checking to see if fullscreen was enabled or not first, which
would lead to the player erroring if the user double-clicks the
video on a platform that does not support fullscreen.

Fixes shaka-project#3441

Change-Id: Id96f783a265e0e05fba93cae2da3904bf1747c9b
  • Loading branch information
theodab committed Jun 1, 2021
1 parent a0d3e52 commit a25fde5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
});

this.eventManager_.listen(this.controlsContainer_, 'dblclick', () => {
if (this.config_.doubleClickForFullscreen) {
if (this.config_.doubleClickForFullscreen && document.fullscreenEnabled) {
this.toggleFullScreen();
}
});
Expand Down

0 comments on commit a25fde5

Please sign in to comment.