fix(player): keep hidden and cycled subtitles off in the next episode
Episode navigation carries the subtitle choice this screen has committed, so a way of turning subtitles off that the screen never sees is undone by the next episode. ExoPlayer has no renderer-level visibility switch, so the player's hide toggle is emulated by deselecting the track. That emulation lasted until the next selection: the automatic pass after an episode change put subtitles straight back on screen while the toggle still read "hidden", and un-hiding then restored a track id belonging to the episode that had already ended. Hiding is now sticky across media opens the way mpv's global sub-visibility is, selections made while hidden become what un-hiding restores, and the toggle no longer refuses to restore because the hidden track reads as Off. Cycling subtitles over the native track list — downloads, and items whose server exposes no subtitle rows — went straight to the track manager, which owns the player selection and the server write-back but not the committed choice. The screen records the cycled track now.
This commit is contained in:
@@ -109,7 +109,20 @@ extension _VideoPlayerCompanionRemoteMethods on VideoPlayerScreenState {
|
||||
if (!_subtitleCycleDrainActive) unawaited(_drainSubtitleCycles());
|
||||
return;
|
||||
}
|
||||
_trackManager?.cycleSubtitleTrack();
|
||||
_cycleSubtitleTrackNatively();
|
||||
}
|
||||
|
||||
/// Cycle through the native track list, for playback with no source
|
||||
/// catalog to advance through (downloads, and items whose server exposes no
|
||||
/// subtitle rows).
|
||||
///
|
||||
/// The manager owns the selection and the server write-back; the committed
|
||||
/// choice is this screen's, and the episode carry-over reads it, so a cycle
|
||||
/// that lands on Off has to be recorded here or the next episode inherits
|
||||
/// the choice this one started with.
|
||||
void _cycleSubtitleTrackNatively() {
|
||||
final cycled = _trackManager?.cycleSubtitleTrack();
|
||||
if (cycled != null) _rememberNativeSubtitleSelection(cycled);
|
||||
}
|
||||
|
||||
Future<void> _drainSubtitleCycles() async {
|
||||
@@ -127,7 +140,7 @@ extension _VideoPlayerCompanionRemoteMethods on VideoPlayerScreenState {
|
||||
if (_isOfflinePlayback || sourceTracks.isEmpty) {
|
||||
_pendingSubtitleCycleCount -= advances;
|
||||
for (var i = 0; i < advances; i++) {
|
||||
_trackManager?.cycleSubtitleTrack();
|
||||
_cycleSubtitleTrackNatively();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user