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: seeking to the last frame restart the video #1338

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

Florent-Bouisset
Copy link
Collaborator

Seeking to the last frame of the video result in restarting the video from the beginning. This is because VideoElement.play() method restart the play from beginning if video is ended.
According to the spec:

If the playback has ended and the direction of playback is forwards,
seek to the earliest possible position of the media resource.

In this case checking if the video is ended and not call play() fixes the issue.

seeking to the last frame of the video result in restarting the video
from the beginning. This is because VideoElement.play() method restart
the play from beginning if video is ended.
According to the spec:
> If the playback has ended and the direction of playback is forwards,
> seek to the earliest possible position of the media resource.

In this case checking if the video is ended and not call play()
fixes the issue.
@Florent-Bouisset Florent-Bouisset added the bug This is an RxPlayer issue (unexpected result when comparing to the API) label Dec 20, 2023
@peaBerberian peaBerberian added this to the 3.33.0 milestone Dec 20, 2023
@peaBerberian
Copy link
Collaborator

peaBerberian commented Dec 20, 2023

Seeking to the last frame of the video result in restarting the video from the beginning

Just to be precise, it's not seeking to the last frame of the video that results in this, it's either starting at the end (through a startAt loadVideo option) or reloading at the end that causes the issue, which implies a seek.

Just seeking at the end in any other context should not trigger the autoplay logic.

@peaBerberian peaBerberian merged commit 4d4417b into master Dec 20, 2023
4 checks passed
@peaBerberian peaBerberian mentioned this pull request Jan 24, 2024
@peaBerberian peaBerberian deleted the fix-seek-on-last-position-restart branch February 7, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is an RxPlayer issue (unexpected result when comparing to the API)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants