PlayerController class

Inheritance

Constructors

PlayerController()

Properties

bufferData Uint8List?
provides data we got after reading audio file
no setter
hashCode int
The hash code for this object.
no setteroverride
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
maxDuration int
provides max duration of currenly provided audio file.
no setter
onCurrentDurationChanged Stream<int>
A Stream to get current duration. This stream will emit duration in milliseconds every 200 milliseconds.
no setter
onPlayerStateChanged Stream<PlayerState>
A stream to get current state of the player. This stream will emit event whenever there is change in the playerState.
no setter
playerKey String
An unique key string associated with this player only
no setter
playerState PlayerState
provides current state of the player
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Calling this will stop the player, it will dispose player in native and also dispose the the controller.
override
getDuration([DurationType? durationType]) Future<int>
Return maximum duration for DurationType.max and current duration for DurationType.current for playing content. The duration is in milliseconds, if no duration is available -1 is returned.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
pausePlayer() Future<void>
Use this to pause the playing audio.
preparePlayer(String path, [double? volume]) Future<void>
Call this to prepare player with optional volume parameters (has to be between 0.0 to 1.0).
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
seekTo(int progress) Future<void>
Moves the media to specified time position. pass progress parameter in milliseconds.
setPlayerState(PlayerState state) → void
setVolume(double volume) Future<bool>
Sets valume for this player. Dosen't throw Exception. Returns false if it couldn't set the volume.
startPlayer({FinishMode finishMode = FinishMode.stop}) Future<void>
Use this function to start the player to play/resume the audio.
stopAllPlayers() → void
This method is to free all players resources all at once.
stopPlayer() Future<void>
Use this to stop player. After calling this, resources are freed.
toString() String
A string representation of this object.
inherited

Operators

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