Skip to content

Commit

Permalink
feat(UI): Add config for refreshTickInSeconds (#6386)
Browse files Browse the repository at this point in the history
Closes #6376

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
  • Loading branch information
MarianoFacundoArch and avelad committed Apr 3, 2024
1 parent 7e32636 commit dbdef5d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -59,6 +59,7 @@ JW Player <*@jwplayer.com>
Konstantin Grushetsky <github@grushetsky.net>
Lucas Gabriel Sánchez <unkiwii@gmail.com>
Martin Stark <martin.stark@eyevinn.se>
Mariano Facundo Scigliano <mfacundo94@gmail.com>
Matthias Van Parijs <matvp91@gmail.com>
Mattias Wadman <mattias.wadman@gmail.com>
Mirego <*@mirego.com>
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -88,6 +88,7 @@ Leandro Ribeiro Moreira <leandro.ribeiro.moreira@gmail.com>
Loïc Raux <loicraux@gmail.com>
Lucas Gabriel Sánchez <unkiwii@gmail.com>
Martin Stark <martin.stark@eyevinn.se>
Mariano Facundo Scigliano <mfacundo94@gmail.com>
Matias Russitto <russitto@gmail.com>
Mathieu Côté <mcote@mirego.com>
Matthias Van Parijs <matvp91@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion ui/controls.js
Expand Up @@ -187,7 +187,7 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget {
this.onCastStatusChange_();

// Start this timer after we are finished initializing everything,
this.timeAndSeekRangeTimer_.tickEvery(/* seconds= */ 0.125);
this.timeAndSeekRangeTimer_.tickEvery(this.config_.refreshTickInSeconds);

this.eventManager_.listen(this.localization_,
shaka.ui.Localization.LOCALE_CHANGED, (e) => {
Expand Down
6 changes: 5 additions & 1 deletion ui/externs/ui.js
Expand Up @@ -92,7 +92,8 @@ shaka.extern.UIVolumeBarColors;
* preferDocumentPictureInPicture: boolean,
* showAudioChannelCountVariants: boolean,
* seekOnTaps: boolean,
* tapSeekDistance: number
* tapSeekDistance: number,
* refreshTickInSeconds: number
* }}
*
* @property {!Array.<string>} controlPanelElements
Expand Down Expand Up @@ -228,6 +229,9 @@ shaka.extern.UIVolumeBarColors;
* right part of the video. If less than or equal to 0,
* no seeking will occur.
* Defaults to 10 seconds.
* @property {number} refreshTickInSeconds
* The time interval, in seconds, to update the seek bar.
* Defaults to 0.125 seconds.
* @exportDoc
*/
shaka.extern.UIConfiguration;
Expand Down
1 change: 1 addition & 0 deletions ui/ui.js
Expand Up @@ -250,6 +250,7 @@ shaka.ui.Overlay = class {
showAudioChannelCountVariants: true,
seekOnTaps: true,
tapSeekDistance: 10,
refreshTickInSeconds: 0.125,
};

// eslint-disable-next-line no-restricted-syntax
Expand Down

0 comments on commit dbdef5d

Please sign in to comment.