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

feat: Add video progress events #5850

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

avelad
Copy link
Member

@avelad avelad commented Nov 3, 2023

Closes #2656

@avelad avelad added type: enhancement New feature or request priority: P2 Smaller impact or easy workaround labels Nov 3, 2023
@avelad avelad added this to the v4.6 milestone Nov 3, 2023
@avelad avelad force-pushed the video-progress-events branch from bed2e68 to 185ddf1 Compare November 3, 2023 08:42
@shaka-bot
Copy link
Collaborator

shaka-bot commented Nov 3, 2023

Incremental code coverage: 96.72%

}
if (hasNewCompletionPercent) {
let event;
if (this.completionPercent_ == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm.
According to MDN, at the slowest, we can expect around 4 timeupdate events per second.
For a very short clip (<25 seconds), if the events are happening at the slowest expected rate, there is the possibility that the completion percent might go up by more than 1 between two events, which could cause us to skip over a quartile event...
I think this would be most likely to happen with the started event, since all that would really need to happen would be for the first timeupdate event to happen at 0.51% progress (so it gets rounded up to 1%).

I don't know how realistic that combination of factors would be in practice, though.

lib/player.js Outdated Show resolved Hide resolved
@avelad avelad requested a review from theodab November 7, 2023 09:16
@avelad avelad merged commit c3beee6 into shaka-project:main Nov 7, 2023
15 of 16 checks passed
@avelad avelad deleted the video-progress-events branch November 7, 2023 09:38
Robloche pushed a commit to Robloche/shaka-player that referenced this pull request Nov 30, 2023
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jan 6, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jan 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Video progress events
3 participants