computeCaptionsManifest function

Future<ClosedCaptionManifest> computeCaptionsManifest(
  1. String videoId
)

Used to not block the UI isolate.

Implementation

Future<ClosedCaptionManifest> computeCaptionsManifest(String videoId) async {
  YoutubeExplode yt = YoutubeExplode();
  ClosedCaptionManifest manifest = await yt.videos.closedCaptions.getManifest(
    videoId,
    formats: [ClosedCaptionFormat.vtt],
  );

  return manifest;
}