initialize method

Future<void> initialize({
  1. bool mute = false,
})

Implementation

Future<void> initialize({bool mute = false}) async {
  try {
    await player.initialize();
    listenToPlayer();
    isInitialized.value = true;
    player.setLooping(true);
    if (mute) await setVolume(0);
    player.play();
  } catch (e) {
    // Bu bir video değilmiş
    isValidVideo.value = false;
  }
}