AudioPlaybackManager class
A global audio manager that ensures only one audio plays at a time, persists playback state, and notifies widgets when state changes.
Constructors
- AudioPlaybackManager()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearActivePlayer(
AudioPlayer player) → void -
Clears the active player if it matches
player. -
disposeAll(
) → Future< void> - Dispose all players — use this on full cleanup.
-
disposePlayer(
String id) → Future< void> - Dispose a specific player.
-
getOrCreatePlayer(
String id, {String? url}) → AudioPlayer -
Returns or creates a player for
id. -
getState(
String id) → AudioPlaybackState -
Returns playback state for
id. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerStopCallback(
String id, VoidCallback onStop) → void -
Registers a callback for UI update when this
id's player stops. -
setActivePlayer(
AudioPlayer player, {required String id}) → Future< void> -
Set
playeras active, pausing previous one if needed. -
toString(
) → String -
A string representation of this object.
inherited
-
unregisterStopCallback(
String id) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited