getVideoMetadata method

Future<VideoFull> getVideoMetadata(
  1. String videoId, {
  2. bool includeTimestampComments = false,
  3. List<Language> filterRecommendationLanguages = const [],
})

Retrieves a video, optionally with comments and recommended videos

Arguments:

  • videoId ID of the video
  • includeTimestampComments If set to true, comments with timestamps will be returned
  • filterRecommendationLanguages Retrieves recommended videos if not empty. This is a list of language codes to filter channels/clips, official streams do not follow this parameter.

Implementation

Future<VideoFull> getVideoMetadata(
  String videoId, {
  bool includeTimestampComments = false,
  List<Language> filterRecommendationLanguages = const [],
}) async {
  final Map<String, dynamic> params = {};
  _addLanguages(filterRecommendationLanguages, params);
  _addCommentsFlag(includeTimestampComments, params);

  final response =
      await get(path: '${HolodexEndpoint.videos}/$videoId', params: params);
  final body = jsonDecode(response.body);
  return VideoFull.fromJson(body);
}