getVideoMetadata method
Retrieves a video, optionally with comments and recommended videos
Arguments:
videoId
ID of the videoincludeTimestampComments
If set totrue
, comments with timestamps will be returnedfilterRecommendationLanguages
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);
}