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/doris 2701 webOS 5 startup improvements (unwanted seek) #102

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

grabofus
Copy link

@grabofus grabofus commented Mar 4, 2025

This PR will...

Fix issues on webOS 5 where an unnecessary seek is performed during startup if the manifest is updated while the first segment is being buffered.

video-dev#6998

Video demonstrating the issue where synchronizeToLiveEdge is triggered as soon as the first segment start getting inserted into the source buffer, but the currentTime is not yet adjusted to start position.

issue_3.mp4

@grabofus grabofus changed the title Fix/doris 2701 startup improvements Fix/doris 2701 webOS 5 startup improvements (unwanted seek) Mar 4, 2025
@grabofus grabofus merged commit 04cc64a into master-doris Mar 4, 2025
8 of 10 checks passed
@grabofus grabofus deleted the fix/DORIS-2701-startup-improvements branch March 4, 2025 16:30
Comment on lines +1355 to +1358
const currentTime =
this.loadedmetadata || mediaCurrentTime > 0
? mediaCurrentTime
: this.startPosition;
Copy link

@robwalch robwalch Mar 4, 2025

Choose a reason for hiding this comment

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

Would getLoadPosition work here?

    const currentTime = this.getLoadPosition();

Copy link
Author

Choose a reason for hiding this comment

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

We might be able to, but we'd need to modify getLoadPosition() to check for media.currentTime as well, not sure if that'd have any impact on the rest of the code.

  protected getLoadPosition(): number {
    const { media } = this;
    // if we have not yet loaded any fragment, start loading from start position
    let pos = 0;
-   if (this.loadedmetadata && media) {
+   if (this.loadedmetadata && media && media.currentTime > 0) {
      pos = media.currentTime;
    } else if (this.nextLoadPosition) {
      pos = this.nextLoadPosition;
    }

    return pos;
  }

Copy link

Choose a reason for hiding this comment

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

I don't think so. getLoadPosition should return the position that should be buffered at any given time. If it determines that it should return media.currentTime and that has a value of 0 then that is the value that should be used, not startPosition or nextLoadPosition.

Copy link
Author

Choose a reason for hiding this comment

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

ah okay, I'll give it a try 👍

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.

3 participants