VlcPlayerPlatform class abstract

The interface that implementations of vlc must implement.

Platform implementations should extend this class rather than implement it as vlc does not consider newly added methods to be breaking changes.

Inheritance
  • Object
  • PlatformInterface
  • VlcPlayerPlatform

Constructors

VlcPlayerPlatform()
Constructs a VlcPlayerPlatform.

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

addAudioTrack(int viewId, {required String uri, required DataSourceType type, bool? isSelected}) Future<void>
Add extra audio to media. uri - uri of audio type - type of subtitle (network or file) isSelected - Set true if you wanna force the added subtitle to start display on media.
addSubtitleTrack(int viewId, {required String uri, required DataSourceType type, bool? isSelected}) Future<void>
Add extra subtitle to media. uri - URL of subtitle type - Set type of subtitle isSelected - Set true if you wanna force the added subtitle to start display on media.
buildView(PlatformViewCreatedCallback onPlatformViewCreated, {bool virtualDisplay = true}) Widget
Returns a widget displaying the video.
castToRenderer(int viewId, String rendererDevice) Future<void>
rendererDevice - name of renderer device Start vlc video casting to the rendered device. Set null if you wanna to stop video casting.
create({required int viewId, required String uri, required DataSourceType type, String? package, bool? autoPlay, HwAcc? hwAcc, VlcPlayerOptions? options}) Future<void>
Creates an instance of a vlc player
dispose(int viewId) Future<void>
Clears one video.
getAudioDelay(int viewId) Future<int?>
Returns the amount of audio track time delay.
getAudioTrack(int viewId) Future<int?>
Returns selected audio track index
getAudioTracks(int viewId) Future<Map<int, String>>
Returns all audio tracks as array of <Int, String> The key parameter is the index of audio track which is used for changing audio and the value is the display name of audio
getAudioTracksCount(int viewId) Future<int?>
Returns the number of audio tracks
getAvailableRendererServices(int viewId) Future<List<String>>
Returns list of all available vlc renderer services
getDuration(int viewId) Future<Duration>
Returns duration/length of loaded video in milliseconds.
getPlaybackSpeed(int viewId) Future<double?>
Returns the vlc playback speed.
getPosition(int viewId) Future<Duration>
Gets the video position as Duration from the start.
getRendererDevices(int viewId) Future<Map<String, String>>
Returns all detected renderer devices as array of <String, String> The key parameter is the name of renderer device and the value is the display name of renderer device
getSpuDelay(int viewId) Future<int?>
Returns the amount of subtitle time delay.
getSpuTrack(int viewId) Future<int?>
Returns the selected spu track index
getSpuTracks(int viewId) Future<Map<int, String>>
Return all subtitle tracks as array of <Int, String> The key parameter is the index of subtitle which is used for changing subtitle and the value is the display name of subtitle
getSpuTracksCount(int viewId) Future<int?>
Return the number of subtitle tracks (both embedded and inserted)
getTime(int viewId) Future<Duration>
Same as getPosition Gets the video position as Duration from the start.
getVideoAspectRatio(int viewId) Future<String?>
Returns video aspect ratio
getVideoScale(int viewId) Future<double?>
Returns video scale
getVideoTrack(int viewId) Future<int?>
Returns selected video track index
getVideoTracks(int viewId) Future<Map<int, String>>
Returns all video tracks as array of <Int, String> The key parameter is the index of video track and the value is the display name of video track
getVideoTracksCount(int viewId) Future<int?>
Returns the number of video tracks
getVolume(int viewId) Future<int?>
Returns current vlc volume level within a range between 0 and 100.
init() Future<void>
Initializes the platform interface and disposes all existing players.
isPlaying(int viewId) Future<bool?>
Returns true if media is playing.
isSeekable(int viewId) Future<bool?>
Returns true if media is seekable.
mediaEventsFor(int viewId) Stream<VlcMediaEvent>
Returns a Stream of VlcMediaEvents.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause(int viewId) Future<void>
Pauses the video playback.
play(int viewId) Future<void>
Starts the video playback.
rendererEventsFor(int viewId) Stream<VlcRendererEvent>
Returns a Stream of VlcRendererEvents.
seekTo(int viewId, Duration position) Future<void>
Sets the video position to a Duration from the start.
setAudioDelay(int viewId, int delay) Future<void>
delay - the amount of time in milliseconds which vlc audio should be delayed. (support both positive & negative value)
setAudioTrack(int viewId, int audioTrackNumber) Future<void>
Change active audio track index (set -1 to mute). audioTrackNumber - the audio track index obtained from getAudioTracks()
setLooping(int viewId, bool looping) Future<void>
Sets the looping attribute of the video.
setPlaybackSpeed(int viewId, double speed) Future<void>
Sets the playback speed to a speed value indicating the playback rate.
setSpuDelay(int viewId, int delay) Future<void>
delay - the amount of time in milliseconds which vlc subtitle should be delayed. (support both positive & negative delay value)
setSpuTrack(int viewId, int spuTrackNumber) Future<void>
Change active subtitle index (set -1 to disable subtitle). spuTrackNumber - the subtitle index obtained from getSpuTracks()
setStreamUrl(int viewId, {required String uri, required DataSourceType type, String? package, bool? autoPlay, HwAcc? hwAcc}) Future<void>
Set/Change video streaming url
setTime(int viewId, Duration position) Future<void>
Same as seekTo Sets the video position to a Duration from the start.
setVideoAspectRatio(int viewId, String aspect) Future<void>
aspect - the video aspect ratio like '16:9' Set video aspect ratio
setVideoScale(int viewId, double scale) Future<void>
scale - the video scale value Set video scale
setVideoTrack(int viewId, int videoTrackNumber) Future<void>
Change active video track index. videoTrackNumber - the video track index obtained from getVideoTracks()
setVolume(int viewId, int volume) Future<void>
Sets the volume to a range between 0 and 100.
startRecording(int viewId, String saveDirectory) Future<bool?>
Returns true if vlc starts recording.
startRendererScanning(int viewId, {String? rendererService}) Future<void>
Start vlc renderer discovery to find external display devices (chromecast)
stop(int viewId) Future<void>
Stops the video playback.
stopRecording(int viewId) Future<bool?>
Returns true if vlc stops recording.
stopRendererScanning(int viewId) Future<void>
Stop vlc renderer and cast discovery
takeSnapshot(int viewId) Future<Uint8List>
Returns binary data for a snapshot of the media at the current frame.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

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