Skip to content

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

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

feat(player): implement dual subtitles, sync offset, and side-by-side comparison viewer#3158
nutine wants to merge 7 commits into
recloudstream:masterfrom
nutine:feat/dual-subtitles

Conversation

@nutine

@nutine nutine commented Sep 6, 2026

Copy link
Copy Markdown

Summary

This pull request implements comprehensive dual subtitle support for CloudStream:

  • Secondary Subtitle Selection: Long press any subtitle track in the subtitle selector dialog to mark it as the secondary subtitle (marked with ✓ [2nd] and haptic feedback).
  • Concurrent Dual Display: Renders the secondary subtitle track at the top of the screen (secondary_subtitle_view) with dedicated layout styling while maintaining the primary subtitle at the bottom.
  • Simultaneous Embedded Track Decoding: Introduces DualDefaultTrackSelector to enable simultaneous playback and decoding of embedded video subtitle tracks alongside external or other embedded tracks.
  • Independent Delay & Sync: Independent offset/delay controls for primary and secondary subtitles in the sync dialog.
  • Hold to Reveal Gesture: Holding on the right side of the screen temporarily pauses playback and reveals the secondary subtitle.
  • Side-by-Side Dual Subtitles Comparison Viewer: Long-pressing the top-right corner opens a full-screen side-by-side timeline dialog where primary and secondary cues are paired opposite each other, highlighting active cues and allowing direct seek by tapping any dialogue row. Playback automatically resumes upon dismissal.
  • Settings Toggle: Option in subtitle settings to always display secondary subtitles.

Test Plan

  • Tested selecting primary and secondary subtitles across both external URL (.srt/.vtt) and embedded video streams.
  • Verified independent subtitle delay offset adjustment and persistence.
  • Tested hold-to-reveal gesture and top-right corner dual comparison viewer with auto-resume.
  • Tested on both phone and TV player layouts.

@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.

- 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 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.

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