Player class

Player

A Player object can be used for media playback. A unique id must be passed for creating & controlling a Player instance.

Player player = Player(id: 0);
player.open([
  Media(uri: 'https://www.example.com/music.mp3'),
  Media(uri: 'file://C:/documents/video.mp4'),
]);
player.play();

Constructors

Player({required int id, bool showWindow = false, String windowTitle = 'libwinmedia', bool startLoop = true})
Player

Properties

audioBalance double
Current audioBalance of the Player.
getter/setter pair
autoplay bool
Current autoplay mode of the Player.
getter/setter pair
downloadProgress double?
Current downloadProgress of the Player.
no setter
hashCode int
The hash code for this object.
no setterinherited
id int
Unique id associated with the Player.
final
isAutoRepeat bool
If the auto repeat is enabled.
getter/setter pair
isLooping bool
Current isLooping mode of the Player.
getter/setter pair
isShuffling bool
If the shuffle is enabled.
getter/setter pair
nativeControls PlayerNativeControls
Player Native Controls
getter/setter pair
position Duration
Current Media playback position of the Player.
no setter
rate double
Current rate of the Player.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ↔ _PlayerState
Current state of the Player. For listening to these values and events, use Player.streams instead.
getter/setter pair
streams ↔ _PlayerStreams
Various event streams to listen to events of a Player.
getter/setter pair
volume double
Current volume of the Player.
getter/setter pair

Methods

add(Media media) → void
Appends a Media to the Player's queue.
back() → void
Jumps to previous Media in the Player's queue.
closeWindow() → void
Closes the video output window of the Player.
dispose() → void
Disposes the Player instance & releases the resources.
jump(int index) → void
Jumps to specified Media's index in the Player's queue.
next() → void
Jumps to next Media in the Player's queue.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(List<Media> medias) → void
Opens a List of Medias into the Player as a queue. Previously opened, added or inserted Medias get removed.
pause() → void
Pauses the Player.
play() → void
Starts playing the Player.
remove(int index) → void
Removes the Media at specified index from the Player's queue.
seek(Duration duration) → void
Seeks the currently playing Media in the Player by specified Duration.
showWindow(String windowTitle) → void
Shows the video output window of the Player.
toString() String
A string representation of this object.
inherited

Operators

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