AudioplayersPlatform 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 AudioplayersPlatform methods.

Inheritance
  • Object
  • PlatformInterface
  • AudioplayersPlatform
Implementers

Constructors

AudioplayersPlatform()

Properties

completeStream Stream<ForPlayer<void>>
no setter
durationStream Stream<ForPlayer<Duration>>
no setter
hashCode int
The hash code for this object.
no setterinherited
positionStream Stream<ForPlayer<Duration>>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seekCompleteStream Stream<ForPlayer<void>>
no setter

Methods

getCurrentPosition(String playerId) Future<int?>
Returns the current position of playback, in milliseconds, if available.
getDuration(String playerId) Future<int?>
Returns the duration of the media, in milliseconds, if available.
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.
release(String playerId) Future<void>
Releases the resources associated with this media player.
resume(String playerId) Future<void>
Resumes the audio that has been paused or stopped.
seek(String playerId, Duration position) Future<void>
Moves the cursor to the desired position.
setAudioContext(String playerId, AudioContext audioContext) Future<void>
setBalance(String playerId, double balance) Future<void>
Sets the stereo balance.
setPlaybackRate(String playerId, double playbackRate) Future<void>
Sets the playback rate.
setPlayerMode(String playerId, PlayerMode playerMode) Future<void>
setReleaseMode(String playerId, ReleaseMode releaseMode) Future<void>
Sets the release mode.
setSourceBytes(String playerId, Uint8List bytes) Future<void>
Configures the play to read the audio from a byte array.
setSourceUrl(String playerId, String url, {bool? isLocal}) Future<void>
Configures the player to read the audio from a URL.
setVolume(String playerId, double volume) Future<void>
Sets the volume (amplitude).
stop(String playerId) Future<void>
Stops the audio that is currently playing.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

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