fix(UI): Allow configure close menu delay time (#8235)

Fixes https://github.com/shaka-project/shaka-player/issues/8224
This commit is contained in:
Álvaro Velad Galván
2025-03-12 09:50:27 +01:00
committed by GitHub
parent 3c789eca42
commit de4bb9e8a8
3 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -134,7 +134,8 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
// seconds in case a user immediately initiates another mouse move to
// interact with the menus. If that didn't happen, go ahead and hide
// the menus.
this.hideSettingsMenusTimer_.tickAfter(/* seconds= */ 2);
this.hideSettingsMenusTimer_.tickAfter(
/* seconds= */ this.config_.closeMenusDelay);
});
/**
+4
View File
@@ -81,6 +81,7 @@ shaka.extern.UIVolumeBarColors;
* trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat,
* textTrackLabelFormat: shaka.ui.Overlay.TrackLabelFormat,
* fadeDelay: number,
* closeMenusDelay: number,
* doubleClickForFullscreen: boolean,
* singleClickForPlayAndPause: boolean,
* enableKeyboardPlaybackControls: boolean,
@@ -182,6 +183,9 @@ shaka.extern.UIVolumeBarColors;
* interacting with them. We recommend setting this to 3 on your cast
* receiver UI.
* Defaults to 0.
* @property {number} closeMenusDelay
* The delay (in seconds) before close the opened menus when the UI is hidden.
* Defaults to 2.
* @property {boolean} doubleClickForFullscreen
* Whether or not double-clicking on the UI should cause it to enter
* fullscreen.
+1
View File
@@ -321,6 +321,7 @@ shaka.ui.Overlay = class {
trackLabelFormat: shaka.ui.Overlay.TrackLabelFormat.LANGUAGE,
textTrackLabelFormat: shaka.ui.Overlay.TrackLabelFormat.LANGUAGE,
fadeDelay: 0,
closeMenusDelay: 2,
doubleClickForFullscreen: true,
singleClickForPlayAndPause: true,
enableKeyboardPlaybackControls: true,