diff --git a/lib/src/cast/RemoteMediaClient.dart b/lib/src/cast/RemoteMediaClient.dart index 6ffeae1..e0ecb85 100644 --- a/lib/src/cast/RemoteMediaClient.dart +++ b/lib/src/cast/RemoteMediaClient.dart @@ -85,19 +85,3 @@ class RemoteMediaClient { this._playerStateNotifier.value = playerState; } } - -/// State of the remote media player -enum PlayerState { - /// Constant indicating unknown player state. - unknown, // 0 - /// Constant indicating that the media player is idle. - idle, // 1 - /// Constant indicating that the media player is playing. - playing, // 2 - /// Constant indicating that the media player is paused. - paused, // 3 - /// Constant indicating that the media player is buffering. - buffering, // 4 - /// Constant indicating that the media player is loading. - loading, // 5 -} diff --git a/lib/src/flutter_cast_framework.dart b/lib/src/flutter_cast_framework.dart index aca4144..99ed4ef 100644 --- a/lib/src/flutter_cast_framework.dart +++ b/lib/src/flutter_cast_framework.dart @@ -110,7 +110,7 @@ class _CastFlutterApiImplementor extends CastFlutterApi { //region RemoteMediaClient @override - void onAdBreakStatusUpdated() { + void onAdBreakStatusUpdated(MediaStatus mediaStatus) { remoteMediaClient.onAdBreakStatusUpdated?.call(); } @@ -140,8 +140,8 @@ class _CastFlutterApiImplementor extends CastFlutterApi { } @override - void onStatusUpdated(int playerStateRaw) { - final playerState = PlayerState.values[playerStateRaw]; + void onStatusUpdated(MediaStatus mediaStatus) { + final playerState = mediaStatus.playerState ?? PlayerState.unknown; remoteMediaClient.dispatchPlayerStateUpdate(playerState); }