feat: Add subtitle sync ui for easy alignment - #6735
Conversation
Cloudflare Pages deployment
|
There was a problem hiding this comment.
- This only works with "custom subtitle element" (doesn't work in Chrome) and obviously only for text (SRT) subtitles.
- We probably should update the subtitles timeline on
timeupdate. - IMO, the timeline is too close to the offset slider, which makes you think they are tied.
- Too long for mobile.
|
Do you have recommendations for 1? I am also open to some guidance on 2. I tried a bunch of things, but I feel like there is an efficient solution my lack of FE knowledge eludes me from. |
When we use native API: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/textTracks
Ideally, we should use jellyfin-web/src/controllers/lyrics.js Lines 162 to 189 in c9ccec8 |
armanckeser
left a comment
There was a problem hiding this comment.
Hmm, does this mean that platforms like WebOS wouldn't be able to use this implementation? I presume WebOS uses a chromiom browser.
|
Still have to think a bit about the realtime updates, the problem is getting a smooth timeline. Updating current implementation on every timeupdate results in the timeline moving choppily every second. I need to increase the resolution for the percentage calculations or add a css transition or something, but I am not sure yet |
|
I tried to implement a smooth scroll, but I just give up. I think this provides the value I would like it to provide. And even though the playback rendering is a bit janky, probably better than not having it at all. |
|
@dmitrylyzo thoughts? |
|
Absolutely incredible |
|
@dmitrylyzo Added screenshots from Firefox, Chrome, WebOS browser. Added realtime update ability and a video from Chrome showing that the changes are accurate with the realtime rendering. Changed the styling to better match Jellyfin Web style. I believe with SSA/ASS and PGS, the subtitle offset menu does not even show up (I tried with PGS and DVD SUB, neither showed the menu), but if it did, the timeline would be hidden. |
|
@dmitrylyzo Would love to learn what types of tests or proof I could add to make this easier to review for the team. |
dmitrylyzo
left a comment
There was a problem hiding this comment.
-
As before, I think the timeline is too close to the offset slider, which makes you think they are tied.
Close:

Split:

-
My biggest concern right now is intermediate refactoring. I prefer to do refactoring first and then add the feature. Ideally, we should make commits atomic. If no one has any objections to the current commit sequence, so be it.
Ah, thanks for the clarification. I thought you meant that the current time marker itself was too close to the button (which it was), but "split" looks much better
I see. Let me try a stacked approach, I am thinking a PR (or commit?) to refactor the original into OffsetController and the SubtitleSync object, and another one to add the timeline view. Does that sound good to you? |
|
|
|
|
|
A bit sad that a year has passed since I opened this PR. I don't think it should take over a year to add a nice feature |
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |
This comment has been minimized.
This comment has been minimized.
e95f674 to
ec5b3ce
Compare
Extract offset state and interaction handling from SubtitleSync into a dedicated OffsetController class. Use real private methods, a currentOffset getter/setter, and a shared slider bubble helper. No user-facing behavior changes. Paves the way for the subtitle sync timeline feature. Add Armanc to CONTRIBUTORS.
Expose the current subtitle track events from the HTML video player and the playback manager in a normalized seconds-based format. This allows the subtitle sync UI to render a timeline of upcoming subtitle events.
Render a scrolling timeline of subtitle events around the current playback position below the offset slider, so users can visually align subtitles with the video. Dragging the offset shifts the subtitle blocks against a fixed time ruler, making the correct alignment easy to find. The timeline reuses pooled DOM nodes and updates their positions on each player time update, keeping it cheap enough to run during playback on mobile. It is only shown for text subtitle tracks whose events can be read back from the player.
ec5b3ce to
1096cbd
Compare
|
|
This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged. |



Changes
chrome_reactive.mp4
Issues
#4364