create static method

Future<NativeVideoRenderer?> create({
  1. required String videoId,
  2. required String videoUrl,
  3. required int width,
  4. required int height,
})

Creates a NativeVideoRenderer instance with the video view.

This is a convenience factory that creates the video view and returns a NativeVideoRenderer instance to control it.

Implementation

static Future<NativeVideoRenderer?> create({
  required String videoId,
  required String videoUrl,
  required int width,
  required int height,
}) async {
  final result = await createVideoView(
    videoId: videoId,
    videoUrl: videoUrl,
    width: width,
    height: height,
  );

  if (result != null && result['success'] == true) {
    return NativeVideoRenderer(videoId);
  }
  return null;
}