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. bool? initShowSubtitle,
  10. String? initPreferredSubtitleLanguage,
  11. String? initPreferredAudioLanguage,
  12. int? initMaxBitRate,
  13. Size? initMaxResolution,
  14. void onCreated(
    1. AvMediaPlayer player
    )?,
  15. Color? backgroundColor,
  16. 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.initShowSubtitle,
  this.initPreferredSubtitleLanguage,
  this.initPreferredAudioLanguage,
  this.initMaxBitRate,
  this.initMaxResolution,
  this.onCreated,
  this.backgroundColor,
  this.sizingMode = SizingMode.keepAspectRatio,
});