XVideoPlayerView class

Renders the active frame of controller into the parent's box. Sizes itself to the parent — wrap in AspectRatio / FittedBox / Hero to control framing.

Single render path: a Flutter Texture widget over the texture the native side hands back at create() time. Android feeds the texture from an `ExoPlayer` via a SurfaceTexture; Apple feeds it from AVPlayerItemVideoOutput; Windows from the Media Engine's frame server through a DXGI shared texture. Because the rendered content lives inside Flutter's compositor:

  • gallery hero / dismiss animations stay buttery
  • RenderRepaintBoundary.toImage (the gallery's snapshot mechanism) sees the actual frame and can freeze it across transitions
  • no per-frame ImageReader round-trip — scrub latency stays at codec-seek speed

Codec crop is handled native-side: Media3's DefaultVideoFrameProcessor (Android) re-applies the codec's crop rect downstream of the broken Huawei SurfaceTexture transform matrix, so the green right-edge artifact never reaches Flutter's sampler. Apple's AVPlayerItemVideoOutput and the Media Engine's frame transfer (Windows) are crop-correct by construction.

Inheritance
Available extensions

Constructors

XVideoPlayerView({Key? key, required XVideoPlayerController controller})
Binds the player whose frames fill the view.
const

Properties

controller → XVideoPlayerController
The player this view renders.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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
sliver({Key? key}) → Widget

Available on Widget, provided by the SliverExtension extension

Wraps this widget in a SliverToBoxAdapter.
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