PlaybackStateMessage class
The playback state which includes a playing boolean state, a processing state such as AudioProcessingStateMessage.buffering, the playback position and the currently enabled actions to be shown in the Android notification or the iOS control center.
Constructors
-
PlaybackStateMessage({AudioProcessingStateMessage processingState = AudioProcessingStateMessage.idle, bool playing = false, List<
MediaControlMessage> controls = const [], List<int> ? androidCompactActionIndices, Set<MediaActionMessage> systemActions = const {}, Duration updatePosition = Duration.zero, Duration bufferedPosition = Duration.zero, double speed = 1.0, DateTime? updateTime, int? errorCode, String? errorMessage, AudioServiceRepeatModeMessage repeatMode = AudioServiceRepeatModeMessage.none, AudioServiceShuffleModeMessage shuffleMode = AudioServiceShuffleModeMessage.none, int? queueIndex}) -
Creates a PlaybackStateMessage with given field values, and with
updateTime
defaulting to DateTime.now. -
PlaybackStateMessage.fromMap(Map<
String, dynamic> map) -
factory
Properties
-
androidCompactActionIndices
→ List<
int> ? -
Up to 3 indices of the controls that should appear in Android's compact
media notification view. When the notification is expanded, all controls
will be shown.
final
- bufferedPosition → Duration
-
The buffered position.
final
-
Whether captioning is enabled.
final
-
controls
→ List<
MediaControlMessage> -
The list of currently enabled controls which should be shown in the media
notification. Each control represents a clickable button with a
MediaActionMessage that must be one of:
final
- errorCode → int?
-
The error code when processingState is AudioProcessingStateMessage.error.
final
- errorMessage → String?
-
The error message when processingState is AudioProcessingStateMessage.error.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- playing → bool
-
Whether audio is either playing, or will play as soon as processingState
is AudioProcessingStateMessage.ready. A true value should be broadcast whenever
it would be appropriate for UIs to display a pause or stop button.
final
- processingState → AudioProcessingStateMessage
-
The audio processing state e.g. AudioProcessingStateMessage.buffering.
final
- queueIndex → int?
-
The index of the current item in the queue, if any.
final
- repeatMode → AudioServiceRepeatModeMessage
-
The current repeat mode.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shuffleMode → AudioServiceShuffleModeMessage
-
The current shuffle mode.
final
- speed → double
-
The current playback speed where 1.0 means normal speed.
final
-
systemActions
→ Set<
MediaActionMessage> -
The set of system actions currently enabled. This is for specifying any
other
MediaActionMessage
s that are not supported by controls, because they do not represent clickable buttons. For example:final - updatePosition → Duration
-
The playback position at updateTime.
final
- updateTime → DateTime
-
The time at which the playback position was last updated.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited