MediaControl class

A button to appear in the Android notification, lock screen, Android smart watch, or Android Auto device. The set of buttons you would like to display at any given moment should be set via AudioServiceBackground.setState.

Each MediaControl button controls a specified MediaAction. Only the following actions can be represented as buttons:

Predefined controls with default Android icons and labels are defined as static fields of this class. If you wish to define your own custom Android controls with your own icon resources, you will need to place the Android resources in android/app/src/main/res. Here, you will find a subdirectory for each different resolution:

drawable-hdpi
drawable-mdpi
drawable-xhdpi
drawable-xxhdpi
drawable-xxxhdpi

You can use Android Asset Studio to generate these different subdirectories for any standard material design icon.

Constructors

MediaControl({@required String androidIcon, @required String label, @required MediaAction action})
const

Properties

action MediaAction
The action to be executed by this control
final
androidIcon String
A reference to an Android icon resource for the control (e.g. "drawable/ic_action_pause")
final
hashCode int
The hash code for this object. [...]
read-only, inherited
label String
A label for the control
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Static Properties

fastForward MediaControl
A default control for MediaAction.fastForward.
final
pause MediaControl
A default control for MediaAction.pause.
final
play MediaControl
A default control for MediaAction.play.
final
rewind MediaControl
A default control for MediaAction.rewind.
final
skipToNext MediaControl
A default control for MediaAction.skipToNext.
final
skipToPrevious MediaControl
A default control for MediaAction.skipToPrevious.
final
stop MediaControl
A default control for MediaAction.stop.
final