feat: player-aware companion remote with syncState, track cycling

This commit is contained in:
edde746
2026-02-10 12:32:00 +01:00
parent 5c3fbfdff8
commit d1af24e0a7
10 changed files with 316 additions and 87 deletions
@@ -37,6 +37,9 @@ class CompanionRemoteReceiver {
VoidCallback? onVolumeUp;
VoidCallback? onVolumeDown;
VoidCallback? onVolumeMute;
VoidCallback? onSubtitles;
VoidCallback? onAudioTracks;
VoidCallback? onFullscreen;
void handleCommand(RemoteCommand command, BuildContext? context) {
appLogger.d('CompanionRemoteReceiver: Handling command: ${command.type}');
@@ -109,17 +112,23 @@ class CompanionRemoteReceiver {
onPreviousTrack?.call();
case RemoteCommandType.subtitles:
onSubtitles?.call();
case RemoteCommandType.audioTracks:
break; // No-op: track cycling not yet implemented
onAudioTracks?.call();
case RemoteCommandType.fullscreen:
simulateKeyPress(LogicalKeyboardKey.keyF);
if (onFullscreen != null) {
onFullscreen!.call();
} else {
simulateKeyPress(LogicalKeyboardKey.keyF);
}
case RemoteCommandType.ping:
case RemoteCommandType.pong:
case RemoteCommandType.ack:
case RemoteCommandType.deviceInfo:
case RemoteCommandType.disconnect:
case RemoteCommandType.syncState:
break;
default: