getLiveVideosFromChannelsQuickly method

Future<List<Video>> getLiveVideosFromChannelsQuickly(
  1. List<String> channelIds
)

Quickly Access Live / Upcoming for a set of Channels

This endpoint is similar to the getLiveVideos method and usually replies much faster. It is more friendly in general. The cost to execute a lookup is significantly cheaper. It's unfortunately less customizable as a result.

Holodex recommends using this if you have a fixed set of channel IDs to look up status for.

Arguments:

  • channelIds List of channel IDs to get the live videos from.

Implementation

Future<List<Video>> getLiveVideosFromChannelsQuickly(
  List<String> channelIds,
) async {
  if (channelIds.isEmpty) {
    return <Video>[];
  }

  final Map<String, dynamic> params = {};
  _addChannels(channelIds, params);

  final response =
      await getEndpoint(HolodexEndpoint.userLive, params: params);
  final List<dynamic> list = jsonDecode(response.body);
  return list.map((video) => Video.fromJson(video)).toList();
}