show static method

Future<void> show(
  1. BuildContext context, {
  2. required String videoUrl,
  3. bool autoPlay = false,
  4. bool muted = false,
  5. bool showControls = true,
  6. Map<String, String>? customHeaders,
  7. Color barrierColor = const Color(0xA604181F),
  8. WidgetBuilder? loadingBuilder,
  9. WidgetBuilder? placeholderBuilder,
  10. double aspectRatio = 16 / 9,
})

Implementation

static Future<void> show(BuildContext context, {
  required String videoUrl,
  bool autoPlay = false,
  bool muted = false,
  bool showControls = true,
  Map<String, String>? customHeaders,
  Color barrierColor = const Color(0xA604181F),
  WidgetBuilder? loadingBuilder,
  WidgetBuilder? placeholderBuilder,
  double aspectRatio = 16 / 9,
}) async {
  return showDialog(
    context: context,
    barrierColor: barrierColor,
    builder: (_) {
      return Center(
        child: ConstrainedBox(
          constraints: const BoxConstraints(
            maxWidth: 800,
          ),
          child: AspectRatio(
            aspectRatio: aspectRatio,
            child: VideoPlayer(
              videoUrl: videoUrl,
              autoPlay: autoPlay,
              muted: muted,
              showControls: showControls,
              customHeaders: customHeaders ?? context.wpWidgetsConfig.videoPlayerCustomHeaders ?? {},
              loadingBuilder: loadingBuilder,
              placeholderBuilder: placeholderBuilder,
              aspectRatio: aspectRatio,
            ),
          ),
        ),
      );
    },
  );
}