getLiveVideosFromChannelsQuickly method Null safety

  1. @override
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.

We recommend 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

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

  final Map<String, dynamic> params = {};

  _addChannels(channelIds, params);

  final response = await get(path: _Constants.userLivePath, params: params);
  final List list = jsonDecode(response.body);
  return list.map((video) => Video.fromMap(video)).toList();
}