Skip to content

Commit e586360

Browse files
committed
fix: watch together same-episode replay blocked
1 parent 075a4a4 commit e586360

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/watch_together/providers/watch_together_provider.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,19 @@ class WatchTogetherProvider with ChangeNotifier {
486486

487487
appLogger.d('WatchTogether: Host exited player, callback set: ${onHostExitedPlayer != null}');
488488

489+
// Clear media info so the next mediaSwitch (even same ratingKey) isn't
490+
// treated as a duplicate by the guard in _handleMediaSwitch.
491+
// copyWith uses ?? so it can't set fields to null — construct directly.
492+
_session = WatchSession(
493+
sessionId: _session!.sessionId,
494+
role: _session!.role,
495+
controlMode: _session!.controlMode,
496+
state: _session!.state,
497+
participants: _session!.participants,
498+
errorMessage: _session!.errorMessage,
499+
hostPeerId: _session!.hostPeerId,
500+
);
501+
489502
// Clear the player callback BEFORE popping so that any mediaSwitch message
490503
// arriving during the pop animation routes to MainScreen's handler instead
491504
// of the dying VideoPlayerScreen.

0 commit comments

Comments
 (0)