initialize method

Future<void> initialize()

Initializes the player with the video source.

This creates the native player, registers a texture for rendering, and starts listening for player events. Must be called before any playback methods.

Implementation

Future<void> initialize() async {
  try {
    final id = await _platform.create(source);
    _playerId = id;
    _listenToEvents(id);
  } catch (e) {
    value = value.copyWith(errorDescription: e.toString());
  }
}