Skip to content

Commit

Permalink
feat(UI): Adds singleClickForPlayAndPause config
Browse files Browse the repository at this point in the history
Closes shaka-project#3821

Change-Id: I94ba5a5e69e9934aff7b50d73a819b463bf9e8aa
  • Loading branch information
theodab committed Jan 5, 2022
1 parent c5a81f5 commit 8aacdcf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/controls.js
Expand Up @@ -1178,7 +1178,7 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {

if (this.anySettingsMenusAreOpen()) {
this.hideSettingsMenusTimer_.tickNow();
} else {
} else if (this.config_.singleClickForPlayAndPause) {
this.onPlayPauseClick_();
}
}
Expand Down
4 changes: 4 additions & 0 deletions ui/externs/ui.js
Expand Up @@ -79,6 +79,7 @@ shaka.extern.UIVolumeBarColors;
* trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat,
* fadeDelay: number,
* doubleClickForFullscreen: boolean,
* singleClickForPlayAndPause: boolean,
* enableKeyboardPlaybackControls: boolean,
* enableFullscreenOnRotation: boolean,
* forceLandscapeOnFullscreen: boolean,
Expand Down Expand Up @@ -154,6 +155,9 @@ shaka.extern.UIVolumeBarColors;
* Whether or not double-clicking on the UI should cause it to enter
* fullscreen.
* Defaults to true.
* @property {boolean} singleClickForPlayAndPause
* Whether or not clicking on the video should cause it to play or pause.
* Defaults to true.
* @property {boolean} enableKeyboardPlaybackControls
* Whether or not playback controls via keyboard is enabled, such as seek
* forward, seek backward, jump to the beginning/end of the video.
Expand Down
1 change: 1 addition & 0 deletions ui/ui.js
Expand Up @@ -233,6 +233,7 @@ shaka.ui.Overlay = class {
trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat.LANGUAGE,
fadeDelay: 0,
doubleClickForFullscreen: true,
singleClickForPlayAndPause: true,
enableKeyboardPlaybackControls: true,
enableFullscreenOnRotation: true,
forceLandscapeOnFullscreen: true,
Expand Down

0 comments on commit 8aacdcf

Please sign in to comment.