Player class

A Player to open & play a Media or Playlist from file, network or asset.

Use Player constructor to create a new instance of a Player. Provide a unique id while instanciating.

Player player = Player(id: 0);

By default, Video widget will adapt to the size of the currently playing video itself. If you wish to override the default video size, then you can pass videoDimensions argument to override the frame size as follows.

Player player = Player(
  id: 0,
  videoDimensions: const VideoDimensions(480, 360)
);

Use various methods & event streams available to control & listen to events of the playback.

Constructors

Player({required int id, VideoDimensions? videoDimensions, List<String>? commandlineArguments})

Properties

audioTrackCount int
Gets audio track count from current MediaSource
no setterinherited
bufferingProgress double
Current buffering progress of the Media.
getter/setter pairinherited
bufferingProgressController StreamController<double>
getter/setter pairinherited
bufferingProgressStream Stream<double>
Stream to listen to current buffering progress of the Media.
getter/setter pairinherited
commandlineArguments List<String>
Commandline arguments passed to this instance of Player.
getter/setter pairinherited
current CurrentState
State of the current & opened MediaSource in Player instance.
getter/setter pairinherited
currentController StreamController<CurrentState>
Internally used StreamControllers,
getter/setter pairinherited
currentStream Stream<CurrentState>
Stream to listen to current & opened MediaSource state of the Player instance.
getter/setter pairinherited
error String
Last error received.
getter/setter pairinherited
errorController StreamController<String>
getter/setter pairinherited
errorStream Stream<String>
Stream to listen to error events.
getter/setter pairinherited
general GeneralState
Volume & Rate state of the Player instance.
getter/setter pairinherited
generalController StreamController<GeneralState>
getter/setter pairinherited
generalStream Stream<GeneralState>
Stream to listen to volume & rate state of the Player instance.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
id int
Id associated with the Player instance.
getter/setter pairinherited
playback PlaybackState
Playback state of the Player instance.
getter/setter pairinherited
playbackController StreamController<PlaybackState>
getter/setter pairinherited
playbackStream Stream<PlaybackState>
Stream to listen to playback state of the Player instance.
getter/setter pairinherited
position PositionState
Position & duration state of the Player instance.
getter/setter pairinherited
positionController StreamController<PositionState>
getter/setter pairinherited
positionStream Stream<PositionState>
Stream to listen to position & duration state of the Player instance.
getter/setter pairinherited
preferredVideoDimensions VideoDimensions?
Explicit video dimensions according to which the pixel buffer will be retrieved & rendered inside the Video widget.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textureId ValueNotifier<int?>
final
videoDimensions VideoDimensions
Dimensions of the currently playing video.
getter/setter pairinherited
videoDimensionsController StreamController<VideoDimensions>
getter/setter pairinherited
videoDimensionsStream Stream<VideoDimensions>
Stream to listen to dimensions of currently playing video.
getter/setter pairinherited

Methods

add(Media source) → void
Appends Media to the Playlist of the Player instance.
inherited
dispose() → void
Destroys the instance of Player & closes all StreamControllers in it.
insert(int index, Media source) → void
Inserts Media to the Playlist of the Player instance at specific index.
inherited
jumpToIndex(int index) → void
Jumps to Media at specific index in the Playlist opened. Pass index as parameter.
inherited
move(int initialIndex, int finalIndex) → void
Moves Media already present in the Playlist of the Player from initialIndex to finalIndex.
inherited
next() → void
Jumps to the next Media in the Playlist opened.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(MediaSource source, {bool autoStart = true}) → void
Opens a new media source into the player.
inherited
pause() → void
Pauses opened MediaSource,
inherited
play() → void
Plays opened MediaSource,
inherited
playOrPause() → void
Play or Pause opened MediaSource,
inherited
previous() → void
Jumps to the previous Media in the Playlist opened.
inherited
remove(int index) → void
Removes Media from the Playlist at a specific index.
inherited
seek(Duration duration) → void
Seeks the Media currently playing in the Player instance, to the provided Duration.
inherited
setAudioTrack(int track) → void
Sets Current Audio Track for the current MediaSource
inherited
setDevice(Device device) → void
Sets playback Device for the instance of Player.
inherited
setEqualizer(Equalizer equalizer) → void
Sets Equalizer for the Player.
inherited
setHWND(int hwnd) → void
inherited
setPlaylistMode(PlaylistMode playlistMode) → void
Changes Playlist playback mode.
inherited
setRate(double rate) → void
Sets playback rate of the Media currently playing in the Player instance.
inherited
setUserAgent(String userAgent) → void
Sets user agent for dart_vlc player.
inherited
setVolume(double volume) → void
Sets volume of the Player instance.
inherited
stop() → void
Stops the Player.
inherited
takeSnapshot(File file, int width, int height) → void
Saves snapshot of a video to a desired File location.
inherited
toString() String
A string representation of this object.
inherited

Operators

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