AvMediaView constructor
const
AvMediaView({
- Key? key,
- AvMediaPlayer? initPlayer,
- String? initSource,
- bool? initAutoPlay,
- bool? initLooping,
- double? initVolume,
- double? initSpeed,
- int? initPosition,
- void onCreated(
- AvMediaPlayer player
- Color? backgroundColor,
- SizingMode sizingMode = SizingMode.keepAspectRatio,
Create a new AvMediaView widget.
If initPlayer
is null, a new player will be created.
You can get the player from onCreated
callback.
backgroundColor
is the color to display when there is no video.
This parameter can be changed by updating the widget.
sizingMode
indicates how to size the video.
This parameter can be changed by updating the widget.
Other parameters only take efferts at the time the widget is mounted. To changed them later, you need to call the corresponding methods of the player.
Implementation
const AvMediaView({
super.key,
this.initPlayer,
this.initSource,
this.initAutoPlay,
this.initLooping,
this.initVolume,
this.initSpeed,
this.initPosition,
this.onCreated,
this.backgroundColor,
this.sizingMode = SizingMode.keepAspectRatio,
});