Add feature-gated dual subtitle MVP with merged subtitle track#2549
Open
beng1z wants to merge 1 commit intorecloudstream:masterfrom
Open
Add feature-gated dual subtitle MVP with merged subtitle track#2549beng1z wants to merge 1 commit intorecloudstream:masterfrom
beng1z wants to merge 1 commit intorecloudstream:masterfrom
Conversation
Add opt-in dual-subtitle support (disabled by default) where the player merges a primary and secondary subtitle track into a single generated WebVTT file at parse time, rather than rendering two overlay tracks. - `IPlayer` gets `setSecondarySubtitles` / `getCurrentSecondarySubtitle` and `isDualSubtitleCombinationSupported`. - `CS3IPlayer` builds the merged track via `DualSubtitleComposer`, caches it under `cacheDir/dual_subtitles/dual_sub_<hash>.vtt` (constants for dir/prefix/extension), reuses the file on reload, and cleans stale entries on episode change. - Network / file I/O for the merge is wrapped in `runBlocking(Dispatchers.IO)` so it never runs on the main thread when `loadOnlinePlayer` is called from the UI thread. - On unsupported combinations (embedded secondary, secondary without primary, unsupported origin pair) the pipeline logs and falls back to the normal single-subtitle path instead of firing an `ErrorEvent` that previously triggered a next-source reload loop. - `GeneratorPlayer` adds a Primary/Secondary selection mode in the source/subtitle dialog (gated on the new preference), uses an Apply-based commit so selections are only sent to the player once, and blocks unsupported combinations with a localized toast. - New `Dual subtitles (experimental)` toggle in subtitle settings (`SUBTITLE_DUAL_ENABLED_KEY`). - Landscape and portrait subtitle dialog layouts get the new tab buttons with `contentDescription` for accessibility, plus a color selector for the active-tab text. - New base strings only; translated locales are left untouched. - `DualSubtitleComposer` + unit tests cover overlap merging, adjacent same-text coalescing, short cue boundaries, primary/secondary-only cases, negative durations, and WebVTT header/timestamp formatting.
ada76ed to
9ff0789
Compare
Author
|
Follow-up update:
I understand the maintainability concern about merging an MVP — if there are specific polish items beyond what's above that need to land before this is acceptable, I'm happy to address them in-place rather than as a follow-up. |
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
offby default).What changed
IPlayerAPI expanded with secondary subtitle methods.CS3IPlayerimplements secondary state, dual merge pipeline, and merged track selection.GeneratorPlayerupdated for Primary/Secondary selection UX and Apply-based commit behavior.Dual subtitles (experimental)switch.DualSubtitleComposer+ unit tests.AI usage disclosure
Testing
./gradlew testStableDebugUnitTest assembleStableDebug --no-daemonpasses.Notes