VideoPlayerPlatform class abstract
The interface that implementations of video_player must implement.
Platform implementations should extend this class rather than implement it as video_player
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
VideoPlayerPlatform methods.
- Inheritance
-
- Object
- PlatformInterface
- VideoPlayerPlatform
- Implementers
Constructors
- VideoPlayerPlatform()
- Constructs a VideoPlayerPlatform.
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
-
buildView(
int playerId) → Widget - Returns a widget displaying the video with a given playerId.
-
buildViewWithOptions(
VideoViewOptions options) → Widget - Returns a widget displaying the video based on given options.
-
create(
DataSource dataSource) → Future< int?> - Creates an instance of a video player and returns its playerId.
-
createWithOptions(
VideoCreationOptions options) → Future< int?> - Creates an instance of a video player based on creation options and returns its playerId.
-
dispose(
int playerId) → Future< void> - Clears one video.
-
getAudioTracks(
int playerId) → Future< List< VideoAudioTrack> > - Gets the available audio tracks for the video.
-
getPosition(
int playerId) → Future< Duration> - Gets the video position as Duration from the start.
-
getVideoTracks(
int playerId) → Future< List< VideoTrack> > - Gets the available video tracks (quality variants) for the video.
-
init(
) → Future< void> - Initializes the platform interface and disposes all existing players.
-
isAudioTrackSupportAvailable(
) → bool - Returns whether audio track selection is supported on this platform.
-
isVideoTrackSupportAvailable(
) → bool - Returns whether video track selection is supported on this platform.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
int playerId) → Future< void> - Stops the video playback.
-
play(
int playerId) → Future< void> - Starts the video playback.
-
seekTo(
int playerId, Duration position) → Future< void> - Sets the video position to a Duration from the start.
-
selectAudioTrack(
int playerId, String trackId) → Future< void> -
Selects which audio track is chosen for playback from its
trackId -
selectVideoTrack(
int playerId, VideoTrack? track) → Future< void> - Selects which video track (quality variant) is chosen for playback.
-
setAllowBackgroundPlayback(
bool allowBackgroundPlayback) → Future< void> - Sets whether the video should continue to play in the background.
-
setLooping(
int playerId, bool looping) → Future< void> - Sets the looping attribute of the video.
-
setMixWithOthers(
bool mixWithOthers) → Future< void> - Sets the audio mode to mix with other sources.
-
setPlaybackSpeed(
int playerId, double speed) → Future< void> -
Sets the playback speed to a
speedvalue indicating the playback rate. -
setPreventsDisplaySleepDuringVideoPlayback(
int playerId, bool preventsDisplaySleepDuringVideoPlayback) → Future< void> - Sets whether the screen is prevented from sleeping during video playback.
-
setVolume(
int playerId, double volume) → Future< void> - Sets the volume to a range between 0.0 and 1.0.
-
setWebOptions(
int playerId, VideoPlayerWebOptions options) → Future< void> - Sets additional options on web.
-
toString(
) → String -
A string representation of this object.
inherited
-
videoEventsFor(
int playerId) → Stream< VideoEvent> - Returns a Stream of VideoEventTypes.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ↔ VideoPlayerPlatform
-
The instance of VideoPlayerPlatform to use.
getter/setter pair