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: computeLivePosition minimum value of media.currentTime #2506

Merged
merged 4 commits into from Feb 26, 2020

Conversation

jony89
Copy link
Contributor

@jony89 jony89 commented Jan 18, 2020

This PR will...

make computeLivePosition to have a minimum value of media.currentTime. and will prevent seeking in case liveSyncPosition <= media.currentTime

Why is this Pull Request needed?

hls.js seeks backwards during live streaming #2494

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

we could just add the liveSyncPosition > media.currentTime condition without touching computeLivePosition function but I think this is more correct that way.

Resolves issues:

#2494

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

@jony89 jony89 requested a review from robwalch January 23, 2020 12:27
@robwalch robwalch added this to the 0.13.2 milestone Feb 25, 2020
src/controller/base-stream-controller.js Outdated Show resolved Hide resolved
tests/unit/controller/stream-controller.js Outdated Show resolved Hide resolved
@jony89
Copy link
Contributor Author

jony89 commented Feb 26, 2020

@robwalch done.

As I wrote

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

we could just add the liveSyncPosition > media.currentTime condition without touching computeLivePosition function but I think this is more correct that way.

--

I really think that computeLivePosition should not return value that is less than the current time as it literally says live. but I've made the requested changes.

@robwalch
Copy link
Collaborator

robwalch commented Feb 26, 2020

I really think that computeLivePosition should not return value that is less than the current time as it literally says live. but I've made the requested changes.

jony89 thanks for making the changes.

computeLivePosition should return a value based on the ideal position. That include allowing enough buffer for the stream to not underbuffer. It doesn't need to know anything about the where the video is. Limiting it to currentTime prevents it from return a safe value, and adds code that we're not using since you're already capping where we can seek to.

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.

None yet

2 participants