parse static method

Future<PlayerKidDataHolder> parse(
  1. String data,
  2. String masterPlaylistUrl
)

Implementation

static Future<PlayerKidDataHolder> parse(
    String data, String masterPlaylistUrl) async {
  List<PlayerKidTrack> tracks = [];
  // List<BetterPlayerAsmsSubtitle> subtitles = [];
  // List<BetterPlayerAsmsAudioTrack> audios = [];
  try {
    final List<List<dynamic>> list = await Future.wait([
      parseTracks(data, masterPlaylistUrl),
      // parseSubtitles(data, masterPlaylistUrl),
      // parseLanguages(data, masterPlaylistUrl)
    ]);
    tracks = list[0] as List<PlayerKidTrack>;
    // subtitles = list[1] as List<BetterPlayerAsmsSubtitle>;
    // audios = list[2] as List<BetterPlayerAsmsAudioTrack>;
  } catch (exception) {
    print("Exception on hls parse: $exception");
  }
  return PlayerKidDataHolder(tracks: tracks);
}