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 during startup on low power devices #7063

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

grabofus
Copy link
Contributor

@grabofus grabofus commented Mar 5, 2025

This PR will...

Fix an edge-case on webOS 5 (and possible other low power devices), where synchronizeToLiveEdge() could seek forward while the first segment was being appended to the buffer.

Why is this Pull Request needed?

Are there any points in the code the reviewer needs to double check?

Resolves issues:

#6998

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

Comment on lines +736 to +740
const mediaCurrentTime = media.currentTime;
const currentTime =
this.hasEnoughToStart || mediaCurrentTime > 0
? mediaCurrentTime
: this.startPosition;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const mediaCurrentTime = media.currentTime;
const currentTime =
this.hasEnoughToStart || mediaCurrentTime > 0
? mediaCurrentTime
: this.startPosition;
const currentTime = this.getLoadPosition();

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getLoadPosition to determine the stream-controller's target position. This will return currentTime when appropriate (even when its value is 0) or nextLoadPosition prior to start and when detached, which unlike startPosition will advance as needed.

@robwalch robwalch added this to the 1.6.0 milestone Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants