AudioPlayerListener class
A class to simplify the usage of callbacks. Specify the needed callbacks and pass the listener to FlutterAudioAsService.setListeners()
Constructors
-
AudioPlayerListener({Function onPlayerStateChanged,
Function onPlayerPositionChanged, Function onPlayerCompleted} )
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
onPlayerCompleted(
) → dynamic - Runs when the given audio source finishes. Could be used to implement playlists (plugin may include playlist somewhere in the future)
-
onPlayerPositionChanged(
Duration position ) → dynamic - Runs whenever there is progress on audio playback. Useful to update a progress bar
-
onPlayerStateChanged(
PlayerState state ) → dynamic - Runs whenever PlayerState changes ex. audio paused, resumed, stopped, loading, idle. Useful for making dynamic play/pause buttons (example app will include later) or having different behaviour for certain UI elements in different player states
-
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 ==(
dynamic other ) → bool -
The equality operator. [...]
inherited