ByteArkPlayer constructor

ByteArkPlayer({
  1. Key? key,
  2. required ByteArkPlayerConfig playerConfig,
  3. ByteArkPlayerListener? listener,
  4. double? width,
  5. double? height,
})

Creates a ByteArkPlayer widget.

Requires a playerConfig for setting up the media source and configurations. Optionally takes width and height to specify the player dimensions.

Implementation

ByteArkPlayer({
  super.key,
  required this.playerConfig,
  this.listener,
  this.width,
  this.height,
}) {
  // Generate a unique playerId using Uuid
  _playerId = const Uuid().v4();
  _controller = MethodChannelByteArkPlayerFlutter(_playerId);
  _initEventListener();
}