AudioplayersPlatformInterface class abstract

The interface that implementations of audioplayers must implement.

Platform implementations should extend this class rather than implement it as audioplayers does not consider newly added methods to be breaking changes. Extending this class (using extends) ensures that the subclass will get the default implementation, while platform implementations that implements this interface will be broken by newly added AudioplayersPlatformInterface methods.

Inheritance
  • Object
  • PlatformInterface
  • AudioplayersPlatformInterface
Implemented types

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

create(String playerId) Future<void>
Create a player instance for the given playerId.
inherited
dispose(String playerId) Future<void>
Dispose the player instance with the given playerId.
inherited
emitError(String playerId, String code, String message) Future<void>
inherited
emitLog(String playerId, String message) Future<void>
inherited
getCurrentPosition(String playerId) Future<int?>
Returns the current position of playback, in milliseconds, if available.
inherited
getDuration(String playerId) Future<int?>
Returns the duration of the media, in milliseconds, if available.
inherited
getEventStream(String playerId) Stream<AudioEvent>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause(String playerId) Future<void>
Pauses the audio that is currently playing.
inherited
release(String playerId) Future<void>
Releases the resources associated with this media player.
inherited
resume(String playerId) Future<void>
Resumes the audio that has been paused or stopped.
inherited
seek(String playerId, Duration position) Future<void>
Moves the cursor to the desired position.
inherited
setAudioContext(String playerId, AudioContext audioContext) Future<void>
inherited
setBalance(String playerId, double balance) Future<void>
Sets the stereo balance.
inherited
setPlaybackRate(String playerId, double playbackRate) Future<void>
Sets the playback rate.
inherited
setPlayerMode(String playerId, PlayerMode playerMode) Future<void>
inherited
setReleaseMode(String playerId, ReleaseMode releaseMode) Future<void>
Sets the release mode.
inherited
setSourceBytes(String playerId, Uint8List bytes, {String? mimeType}) Future<void>
Configures the play to read the audio from a byte array.
inherited
setSourceUrl(String playerId, String url, {bool? isLocal, String? mimeType}) Future<void>
Configures the player to read the audio from a URL.
inherited
setVolume(String playerId, double volume) Future<void>
Sets the volume (amplitude).
inherited
stop(String playerId) Future<void>
Stops the audio that is currently playing.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance AudioplayersPlatformInterface
The default instance of AudioplayersPlatformInterface to use.
getter/setter pair