SimplePlayerSettings.network constructor

SimplePlayerSettings.network({
  1. required String path,
  2. String? label = '',
  3. double? aspectRatio = 16 / 9,
  4. bool? autoPlay = false,
  5. bool? loopMode = false,
  6. bool? forceAspectRatio = false,
  7. Color? colorAccent = Colors.red,
})

SimplePlayerSettings properties can be configured in the following ways:

String? path;

Defines the origin of the file, which can be: SimplePlayerSettings.network (Video URL) SimplePlayerSettings.assets (Path of a video file)

String? label;

Sets the title displayed at the top dropdown of the video.

double? aspectRatio; (default 16:9)

Sets SimplePlayer's aspect ratio, this can let black embroideries on the video without distorting the image.

bool? forceAspectRatio

True case: Forces the video to fit the Player's aspect ratio, this may distort the image.

Examples:

  • aspectRatio: 1 / 1,
  • forceAspectRatio: false

bee

  • aspectRatio: 1 / 1,
  • forceAspectRatio: true

bee

bool? autoPlay;

If true: as soon as the Player is built the video will be played automatically.

bool? loopMode;

If true: As soon as the video finishes playing, it will restart automatically.

Color? colorAccent;

Sets the SimplePlayer details color.

Implementation

factory SimplePlayerSettings.network(
    {required String path,
    String? label = '',
    double? aspectRatio = 16 / 9,
    bool? autoPlay = false,
    bool? loopMode = false,
    bool? forceAspectRatio = false,
    Color? colorAccent = Colors.red}) {
  return SimplePlayerSettings(
    type: 'network',
    path: path,
    label: label,
    aspectRatio: aspectRatio,
    autoPlay: autoPlay,
    loopMode: loopMode,
    forceAspectRatio: forceAspectRatio,
    colorAccent: colorAccent,
  );
}