AvMediaView constructor

const AvMediaView({
  1. Key? key,
  2. AvMediaPlayer? initPlayer,
  3. String? initSource,
  4. bool? initAutoPlay,
  5. bool? initLooping,
  6. double? initVolume,
  7. double? initSpeed,
  8. int? initPosition,
  9. void onCreated(
    1. AvMediaPlayer player
    )?,
  10. Color? backgroundColor,
  11. 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,
});