VideoPlayerValue class

The duration, current position, buffering state, error state and settings of a VideoPlayerController.

Constructors

VideoPlayerValue({@required Duration duration, Size size, Duration position = const Duration(), DateTime absolutePosition, List<DurationRange> buffered = const <DurationRange>[], bool isPlaying = false, bool isLooping = false, bool isBuffering = false, double volume = 1.0, double speed = 1.0, String errorDescription, bool isPip = false})
Constructs a video with the given values. Only duration is required. The rest will initialize with default values when unset.
VideoPlayerValue.erroneous(String errorDescription)
Returns an instance with a null Duration and the given errorDescription.
VideoPlayerValue.uninitialized()
Returns an instance with a null Duration.

Properties

absolutePosition DateTime
The current absolute playback position. [...]
final
aspectRatio double
Returns size.width / size.height when size is non-null, or 1.0. when size is null or the aspect ratio would be less than or equal to 0.0.
read-only
buffered List<DurationRange>
The currently buffered ranges.
final
duration Duration
The total duration of the video. [...]
final
errorDescription String
A description of the error if present. [...]
final
hasError bool
Indicates whether or not the video is in an error state. If this is true errorDescription should have information about the problem.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
initialized bool
Indicates whether or not the video has been loaded and is ready to play.
read-only
isBuffering bool
True if the video is currently buffering.
final
isLooping bool
True if the video is looping.
final
isPip bool
Is in Picture in Picture Mode
final
isPlaying bool
True if the video is playing. False if it's paused.
final
position Duration
The current playback position.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
size Size
The size of the currently loaded video. [...]
final
speed double
The current speed of the playback
final
volume double
The current volume of the playback.
final

Methods

copyWith({Duration duration, Size size, Duration position, DateTime absolutePosition, List<DurationRange> buffered, bool isPlaying, bool isLooping, bool isBuffering, double volume, String errorDescription, double speed, bool isPip}) VideoPlayerValue
Returns a new instance that has the same values as this current instance, except for any overrides passed in as arguments to copyWidth.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
override

Operators

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