A StatelessWidget that instantiates a native platform view for video playback.

TargetVideoPlayerView

Constructor:

TargetVideoPlayerView({
  Key? key,
  ValueChanged<int>? onCreated,
  Size? size,
});
  • onCreated: Callback with viewId once the platform view is created.
  • size: Optional width/height for the view container (defaults to 320×180).

TargetVideoPlayer

Holds player configuration and reference ID.

Constructor:

TargetVideoPlayer({
  required String playerReference,
  bool? controlAutoplay,
  bool? scrollOnAd,
  String? creditsLabelColor,
  int? setCornerRadius,
  String? localization,
  int? doubleTapSeek,
  int? seekPreview,
})
  • playerReference: Unique identifier for the player instance.
  • All other fields are optional customization parameters.

TargetvideoFlutterPluginPlatform (Abstract)

Defines the interface for platform-specific implementations.

  • Future load(...): Load video with given parameters.
  • Other methods (e.g., pauseVideo, resumeVideo, etc.) must be implemented by concrete subclasses.

MethodChannelTargetvideoFlutterPlugin

Default implementation using MethodChannel and EventChannel.

  • Method Channel: targetvideo_flutter_plugin
  • Event Channel: targetvideo_flutter_plugin/events

Key Methods:

Future<void> load(...)  // invokes `load` on the native side
Stream<Map<String, dynamic>> events // broadcast stream of native events