Skip to content

feat(player): implement dual subtitles, sync offset, and side-by-side comparison viewer - #3158

Open
nutine wants to merge 8 commits into
recloudstream:masterfrom
nutine:feat/dual-subtitles
Open

nutine wants to merge 8 commits into
recloudstream:masterfrom
nutine:feat/dual-subtitles

Conversation

@nutine

@nutine nutine commented Sep 6, 2026

Copy link
Copy Markdown

Adds dual subtitle support to the player:

  • Long-pressing any subtitle in the selector marks it as secondary ([2nd]), which renders at the top of the screen while the primary subtitle stays at the bottom.
  • Custom DualDefaultTrackSelector so two embedded tracks (or embedded + external) can be decoded simultaneously in ExoPlayer.
  • Separate sync/delay offset controls for the secondary subtitle in the sync dialog.
  • Side-by-side comparison dialog (opened by long-pressing the top-right corner of the player) that pairs both subtitle timelines together. Tapping any line seeks to that timestamp. Playback auto-resumes on dialog close.
  • Holding the right side of the screen pauses and reveals the secondary subtitle if not set to always visible.
  • Setting in player preferences to always keep secondary subtitles visible.

Tested on phone and Android TV with both external URL subtitles (.srt / .vtt) and embedded MKV/MP4 tracks.


Note on AI usage (per AI Policy): An LLM was used for assistance with boilerplate and initial drafting, but the implementation, track selector logic, and player integration were refined and tested manually on device.

@nutine
nutine force-pushed the feat/dual-subtitles branch 6 times, most recently from 5c197a9 to 17edcd8 Compare September 12, 2026 20:39
@fire-light42

Copy link
Copy Markdown
Collaborator

This is a lot of different changes. Please split them into separate pull requests which can be reviewed and merged separately. Not every single feature needs to be separate, but dual subtitles, general UI improvements and AI translations all require their own independent review.

@nutine
nutine force-pushed the feat/dual-subtitles branch from 17edcd8 to d7d99a9 Compare September 13, 2026 23:13
@nutine

nutine commented Sep 13, 2026

Copy link
Copy Markdown
Author

Thanks for the feedback! I have scoped this pull request down strictly to Dual Subtitles & Comparison Viewer. I am opening separate, independent pull requests for the general UI/gesture improvements and the AI subtitle translation feature.

- Add secondary subtitle track support in CS3IPlayer with out-of-band loading and parsing
- Handle Cloudflare WAF on subtitle fetches with Referer and User-Agent headers
- Integrate secondary_subtitle_view into phone and TV player layouts
- Add hardware vibration utility for haptic feedback
- Add long-press gesture in subtitle selection dialog to pick or clear secondary subtitle
- Display ✓ [2nd] badge for active secondary subtitle with haptic feedback
- Add settings toggle to always show secondary subtitle
…for secondary subtitles

- Support separate delay/offset adjustments for primary and secondary subtitles
- Prompt subtitle selection (primary vs secondary) in sync dialog when secondary subtitle is active
- Add hold-to-reveal gesture on right 30% of screen to temporarily pause playback and reveal secondary subtitle
- Add full-screen dual subtitles timeline comparison dialog (dialog_dual_subtitles)
- Align primary and secondary cues into paired chronological rows via DualSubtitleAdapter
- Highlight active cues with progress indicator and allow seeking to any dialogue on tap
- Trigger viewer dialog via long-press in the top-right corner of the player
- Add secondary TextRenderer to ExoPlayer RenderersFactory for simultaneous embedded track decoding
- Implement applySubtitleSelection to independently route primary and secondary tracks via DefaultTrackSelector
- Collect streaming embedded cues into primary and secondary cue lists
- Remove embedded origin guard that blocked secondary subtitle selection
…dded track decoding

- Add DualDefaultTrackSelector to route secondaryTrackId directly to secondary TextRenderer in selectAllTracks
- Match cues by playback position in pushSecondaryCues so secondary embedded subtitles persist when paused
- Retain recorded cues across playback states
@nutine
nutine force-pushed the feat/dual-subtitles branch from d7d99a9 to d5cf9ef Compare September 16, 2026 18:17
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.

2 participants