MediaStatus handling flutter
This commit is contained in:
parent
1ae9006756
commit
bae07bda32
2 changed files with 3 additions and 19 deletions
|
|
@ -85,19 +85,3 @@ class RemoteMediaClient {
|
||||||
this._playerStateNotifier.value = playerState;
|
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
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ class _CastFlutterApiImplementor extends CastFlutterApi {
|
||||||
|
|
||||||
//region RemoteMediaClient
|
//region RemoteMediaClient
|
||||||
@override
|
@override
|
||||||
void onAdBreakStatusUpdated() {
|
void onAdBreakStatusUpdated(MediaStatus mediaStatus) {
|
||||||
remoteMediaClient.onAdBreakStatusUpdated?.call();
|
remoteMediaClient.onAdBreakStatusUpdated?.call();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,8 +140,8 @@ class _CastFlutterApiImplementor extends CastFlutterApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onStatusUpdated(int playerStateRaw) {
|
void onStatusUpdated(MediaStatus mediaStatus) {
|
||||||
final playerState = PlayerState.values[playerStateRaw];
|
final playerState = mediaStatus.playerState ?? PlayerState.unknown;
|
||||||
remoteMediaClient.dispatchPlayerStateUpdate(playerState);
|
remoteMediaClient.dispatchPlayerStateUpdate(playerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue