AudioPlayerAdapter class abstract

Pluggable backend for audio playback. Implement against your preferred player package (just_audio, audioplayers, flutter_sound, etc.) so media_pro itself stays free of audio-engine dependencies.

One adapter instance corresponds to one underlying player. Coordinate "only one playing at a time" through AudioMessageController, which owns the adapter and pauses on source changes.

Constructors

AudioPlayerAdapter()

Properties

durationStream Stream<Duration?>
Emits duration once the source has been parsed by the player. Null while loading.
no setter
hashCode int
The hash code for this object.
no setterinherited
playingStream Stream<bool>
Emits true when actively playing, false when paused / stopped.
no setter
positionStream Stream<Duration>
Emits the playhead position for the loaded source.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() Future<void>
Release native resources. Called by AudioMessageController.dispose.
load(String source) Future<void>
Load a new source (URL or local path). Resets position to zero.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() Future<void>
Pause playback. Position is preserved.
play() Future<void>
Resume / start playback of the currently loaded source.
seek(Duration position) Future<void>
Seek the currently loaded source to position.
toString() String
A string representation of this object.
inherited

Operators

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