AVVideoPlayer class

Displays video from an AVPlayerController with optional controls and gestures.

By default, renders just the native Texture. Set showControls to true to add an animated overlay with play/pause, seek slider, skip buttons, and more.

// Simple — just the video
AVVideoPlayer(controller)

// With built-in controls and gestures
AVVideoPlayer(
  controller,
  showControls: true,
  gestureConfig: const AVGestureConfig(),
)
Inheritance

Constructors

AVVideoPlayer(AVPlayerController controller, {Key? key, bool showControls = false, AVControlsConfig? controlsConfig, Widget controlsBuilder(BuildContext context, AVPlayerController controller)?, AVGestureConfig? gestureConfig, String? title, VoidCallback? onFullscreen, VoidCallback? onNext, VoidCallback? onPrevious})
const
AVVideoPlayer.live(AVPlayerController controller, {Key? key, String? title, VoidCallback? onFullscreen, Widget controlsBuilder(BuildContext context, AVPlayerController controller)?, AVControlsConfig? controlsConfig})
Live stream preset — no seek bar, no skip, live indicator style.
const
AVVideoPlayer.music(AVPlayerController controller, {Key? key, String? title, VoidCallback? onNext, VoidCallback? onPrevious, Widget controlsBuilder(BuildContext context, AVPlayerController controller)?, AVControlsConfig? controlsConfig})
Music player preset — simple controls, no video gestures.
const
AVVideoPlayer.short(AVPlayerController controller, {Key? key, String? title, VoidCallback? onNext, VoidCallback? onPrevious, Widget controlsBuilder(BuildContext context, AVPlayerController controller)?})
Short-form content preset — minimal controls, auto-loop friendly.
const
AVVideoPlayer.video(AVPlayerController controller, {Key? key, String? title, VoidCallback? onFullscreen, VoidCallback? onNext, VoidCallback? onPrevious, Widget controlsBuilder(BuildContext context, AVPlayerController controller)?, AVControlsConfig? controlsConfig, AVGestureConfig? gestureConfig})
Full video player preset — all controls, gestures, and PIP enabled.
const

Properties

controller AVPlayerController
The player controller to render.
final
controlsBuilder Widget Function(BuildContext context, AVPlayerController controller)?
A custom controls builder that replaces the built-in AVControls. When provided, controlsConfig is ignored.
final
controlsConfig AVControlsConfig?
Configuration for the built-in controls. Only used when showControls is true.
final
gestureConfig AVGestureConfig?
Configuration for gesture detection. When non-null, a gesture layer is added.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onFullscreen VoidCallback?
Called when the fullscreen button is pressed.
final
onNext VoidCallback?
Called when the next track button is pressed.
final
onPrevious VoidCallback?
Called when the previous track button is pressed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showControls bool
Whether to show the built-in controls overlay. Defaults to false.
final
title String?
Optional title shown in the controls top bar.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AVVideoPlayer>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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