Repository navigation
Make UI Clip API aware - #211
Merged
Merged
Conversation
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 21cc64f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Collaborator
|
For React, should we also add a |
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
Added it. I was thinking it would be more complicated than this. |
MattiasBuelens
requested changes
Oct 17, 2026
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
MattiasBuelens
approved these changes
Oct 20, 2026
Merged
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.
Summary
Adds support for the Clip API (
player.clip.startTime/player.clip.endTime).When a clip is set, the player keeps
durationat the full stream length andcurrentTimeas an absolute stream position. Onlyseekablenarrows to the clip window. The seek bar already followsseekable, so it was clipped correctly. The time displays, seek button and seek bar aria text were not clip-aware. For example, a 30–40s clip of a 9:56 stream showed00:35 / 09:56instead of00:05 / 00:10.Changes
@theoplayer/web-uigetClipEndTime(player)insrc/util/ClipUtils.ts, which returnsmin(player.duration, player.clip.endTime).DurationDisplay: show the clip length.TimeDisplay: show the current time and the total relative to the clip start.PreviewTimeDisplay: show the hover time relative to the clip start.SeekButton: clamp seeking to the clip window instead of[0, duration].TimeRange: make the aria value text clip-relative.DurationDisplay,TimeDisplay,PreviewTimeDisplay,TimeRange) also update whenplayer.clipfireschange.@theoplayer/react-uiuseCliphook that returns the clip's{ startTime, endTime }and updates when the clip changes. Without a clip it returns{ startTime: 0, endTime: Infinity }.useDurationanduseCurrentTimehooks still return raw player values, so they are not relative to the clip.Chapters, ad markers, preview thumbnails and stream type detection stay on absolute stream time, so they are unchanged. The
TimeRangepreview event also stays absolute.This follows the approach in the VJS-based UI, which also uses the clip end for the duration and listens to
clipchange.Testing
npm run test:typecheck,npm run build,npm run test:unitand Prettier pass, in the root package and inreact/.