Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Seek delay for Cast Nest hub #7423

Merged
merged 7 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions demo/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ shakaDemo.Config = class {
.addNumberInput_('Gap detection threshold',
'streaming.gapDetectionThreshold',
/* canBeDecimal= */ true)
.addNumberInput_('Seeking delay Chromecast',
'streaming.seekSlowDelay',
/* canBeDecimal= */ true)
.addNumberInput_('Gap padding',
'streaming.gapPadding',
/* canBeDecimal= */ true)
Expand Down
7 changes: 7 additions & 0 deletions externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ shaka.extern.LiveSyncConfiguration;
* alwaysStreamText: boolean,
* startAtSegmentBoundary: boolean,
* gapDetectionThreshold: number,
* seekSlowDelay: number,
* gapPadding: number,
* gapJumpTimerTime: number,
* durationBackoff: number,
Expand Down Expand Up @@ -1630,6 +1631,12 @@ shaka.extern.LiveSyncConfiguration;
* jump.
* <br>
* Defaults to <code>0.5</code>.
* @property {number} seekSlowDelay
* The minimum time duration (in seconds) before we can operate a new seek
* it's for devices which have slow seek time.
* Even now, it does not apply to Android based Chromecasts
* <br>
* Defaults to <code>1</code>.
* @property {number} gapPadding
* Padding added only for Xbox, Legacy Edge and Tizen.
* Based on our research (specific to Tizen), the gapPadding value must be
Expand Down
3 changes: 2 additions & 1 deletion lib/media/playhead.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ shaka.media.MediaSourcePlayhead = class {
// infinite loop on systems where changing currentTime takes a
// significant amount of time (e.g. Chromecast).
const time = Date.now() / 1000;
if (!this.lastCorrectiveSeek_ || this.lastCorrectiveSeek_ < time - 1) {
if (!this.lastCorrectiveSeek_ ||
this.lastCorrectiveSeek_ < time - this.config_.seekSlowDelay) {
this.lastCorrectiveSeek_ = time;
canCorrectiveSeek = true;
}
Expand Down
1 change: 1 addition & 0 deletions lib/util/player_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ shaka.util.PlayerConfiguration = class {
gapDetectionThreshold: 0.5,
gapPadding: 0.01,
gapJumpTimerTime: 0.25 /* seconds */,
seekSlowDelay: 1, /* seconds used for Chromecast and other cast devices*/
durationBackoff: 1,
// Offset by 5 seconds since Chromecast takes a few seconds to start
// playing after a seek, even when buffered.
Expand Down
Loading