get method

Gets the actual closed caption track which is identified by the specified metadata.

Implementation

Future<ClosedCaptionTrack> get(ClosedCaptionTrackInfo trackInfo) async {
  var response = await re.ClosedCaptionClient.get(_httpClient, trackInfo.url);

  var captions = response.closedCaptions
      .where((e) => !e.text.isNullOrWhiteSpace)
      .map((e) => ClosedCaption(e.text, e.offset, e.duration,
          e.parts.map((f) => ClosedCaptionPart(f.text, f.offset))));
  return ClosedCaptionTrack(captions);
}