open method

  1. @override
Future<void> open(
  1. GeneralLibraryPlayerPlayableBase playable, {
  2. bool play = true,
  3. bool isLoop = false,
})
override

Implementation

@override
Future<void> open(
  GeneralLibraryPlayerPlayableBase playable, {
  bool play = true,
  bool isLoop = false,
}) async {
  if (playable is GeneralLibraryPlayerMediaBase) {
    // GeneralLibraryPlayerMediaBase generalLibraryPlayerMediaBase = (playable);
    await player.open(
      playable.toMediaMediaKit(),
      play: play,
    );
  }
  if (playable is GeneralLibraryPlayerPlayListBase) {
    await player.open(
      playable.toPlayListMediaKit(),
      play: play,
    );
  }
  if (isLoop) {
    await player.setPlaylistMode(PlaylistMode.loop);
  }
  return;
}