Add video progress milestone tracking hook#15916
Merged
Merged
Conversation
a74275e to
98fc40d
Compare
SHession
commented
May 19, 2026
Contributor
Author
There was a problem hiding this comment.
I may have gotten a little carried away with the refactor here. I can split it out if needed.
98fc40d to
7e36a11
Compare
7e36a11 to
3275779
Compare
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
SHession
commented
May 19, 2026
Comment on lines
+11
to
+13
| * Returns a function that should be called on each time update. | ||
| * It tracks when a video crosses the 25%, 50% and 75% milestones and | ||
| * calls the provided callback for each. |
Contributor
Author
There was a problem hiding this comment.
This will currently only fire once per video. There is ongoing debate about whether this is desirable.
abeddow91
approved these changes
May 20, 2026
Contributor
abeddow91
left a comment
There was a problem hiding this comment.
This is a really nice abstraction! Tested on CODE and looks good to me 👍
abeddow91
reviewed
May 20, 2026
…tracking behaviour
3275779 to
2b4f035
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
This change implements video progress milestone tracking using a React hook and updates both the SelfHosted and YouTube players to use it. It will send events to Ophan when the video has progressed 25/50/75 percent through the video. If a user skips forward, tracking events will be sent for all milestones they have surpassed.
Current YouTube Atom Player implementation:
dotcom-rendering/dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomPlayer.tsx
Lines 252 to 311 in 20bd1ec
Why?
Implementing this tracking for long-form video will help inform us how far through videos readers progressed.