Skip to content

Conversation

@ronalduQualabs
Copy link
Contributor

@ronalduQualabs ronalduQualabs commented Dec 8, 2025

This PR resolves 12 also resolves 205 adds tracking of played ranges to the iframe based media elements. Played time ranges are merged if they overlap, and seeking is properly taken into account, providing an accurate representation of which parts of the video have been played.

Add this ability to:

Youtube
Vimeo
Twitch
TikTok
Spotify Audio

@vercel
Copy link

vercel bot commented Dec 8, 2025

@ronalduQualabs is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@snyk-io
Copy link

snyk-io bot commented Dec 8, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@luwes
Copy link
Collaborator

luwes commented Dec 9, 2025

This looks good. There is an indenting and line space issue.

I think it would be good to make this a mixin utility like @heff pointed out so it could be used for other iframe video elements.

Something like
https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/

let MyMixin = (superclass) => class extends superclass {
  foo() {
    console.log('foo from MyMixin');
  }
};

You might have to override the dispatchEvent method to execute code before the events are fired.
Don't use Vimeo's API in this mixin but use the HTMLVideoElement API so the util can be shared with the others.

@ronalduQualabs ronalduQualabs requested a review from luwes December 10, 2025 17:14
@ronalduQualabs
Copy link
Contributor Author

ronalduQualabs commented Dec 10, 2025

@luwes It's ok if we close this one then in another issue migrate this logic into a mixin ?

@luwes luwes changed the title Add played ranges tracking to Vimeo element with overlap merging feat: Add played ranges tracking to Vimeo element Dec 18, 2025
@ronalduQualabs ronalduQualabs changed the title feat: Add played ranges tracking to Vimeo element feat: Add played ranges tracking to iframe based media elements Jan 5, 2026
Comment on lines +7 to +8
addPlayedRange(start: number, end: number): void;
readonly played: TimeRanges;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should also add (onPlaybackStart, onSeeking, onSeeked, etc)

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.

Make played ranges tracking generic to be used beyond vimeo element [Vimeo] Not able to access HTMLMediaElement.played

3 participants