Skip to content

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

Open
nutine wants to merge 10 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 10 commits into
recloudstream:masterfrom
nutine:feat/dual-subtitles

Conversation

@nutine

@nutine nutine commented Sep 6, 2026

Copy link
Copy Markdown

Summary

  • Secondary Subtitle Support: Long press in the subtitle selector dialog to pick a secondary subtitle (marked with ✓ [2nd] and haptic feedback).
  • Dual Display: Renders the secondary subtitle track at the top of the screen with dedicated layout styling while keeping the primary subtitle at the bottom.
  • Simultaneous Embedded Track Decoding: Custom DualDefaultTrackSelector supporting concurrent playback of embedded video subtitle tracks.
  • Independent Delay & Sync: Separate 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 of the player opens a full-screen side-by-side timeline view where primary and secondary lines are paired opposite each other, highlighting active cues and allowing direct seek by tapping any dialogue row. Automatically resumes playback on dialog close.
  • Gesture-Based Sentence Navigation: Two-finger tap or swipe (left/right) to jump directly between previous and next subtitle cues with on-screen HUD preview.
  • AI Subtitle Translation (Gemini): Real-time subtitle translation using Google Gemini with zero-latency thinking budget, automatic multi-model failover, on-disk media-keyed caching, and in-dialog progress animation with flag indicators.
  • Player Settings: Dedicated Gemini API key configuration in Player Subtitles settings, plus setting to always show secondary subtitles.

Test Plan

  • Tested picking primary and secondary subtitles on URL and embedded streams.
  • Verified individual subtitle offset adjustment and persistence.
  • Tested right-side hold to reveal and top-right corner dual comparison viewer with auto-resume.
  • Tested two-finger subtitle jumping gestures with visual HUD.
  • Tested AI translation with sample subtitle files, caching, and failover.
  • Tested both phone and TV player layouts.

@nutine
nutine force-pushed the feat/dual-subtitles branch 2 times, most recently from d5ffc2d to 00450fb Compare September 6, 2026 20:43
- 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
@nutine
nutine force-pushed the feat/dual-subtitles branch from 00450fb to 45a0cdb Compare September 7, 2026 11:18
- 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 7f75e14 to a549000 Compare September 8, 2026 20:44
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