VideoViewController class
Controller used to call the functions that
controls the VideoView
in Android and the AVPlayer
in iOS.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- videoFile → VideoFile?
-
Returns the video file loaded in the player.
The
info
attribute is loaded when the player reaches the prepared state.no setter
Methods
-
currentPosition(
) → Future< int> - Gets the current position of time in seconds. Returns the current position of playback in milliseconds.
-
dispose(
) → void - Disposes and stops some tasks from the controller.
-
isPlaying(
) → Future< bool?> - Gets the state of the player. Returns true if the player is playing or false if is stopped or paused.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → Future< bool> - Pauses the playback of the video. Use play to resume the playback at any time.
-
play(
) → Future< bool> - Starts/resumes the playback of the video.
-
seekTo(
int position) → Future< bool> -
Moves the cursor of the playback to an specific time.
Must give the
position
of the specific millisecond of playback, if theposition
is bigger than the duration of source the duration of the video is used as position. -
setVideoSource(
String source, {VideoSourceType sourceType = VideoSourceType.file, bool? requestAudioFocus}) → Future< void> -
Sets the video source from an asset file.
The
sourceType
parameter could be VideoSourceType.asset, VideoSourceType.file or VideoSourceType.network -
setVolume(
double volume) → Future< bool> - Sets the volume of the player.
-
stop(
) → Future< bool> - Stops the playback of the video.
-
toggleSound(
) → Future< bool> - Changes the state of the volume between muted and not muted. Returns true if the change was successful or false if an error happened.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
init(
int id, _NativeVideoViewState videoViewState) → Future< VideoViewController> - Initialize the controller.