updatePublishingLayers method

Future<void> updatePublishingLayers(
  1. LocalTrack? track,
  2. List<SubscribedQuality> layers
)

Implementation

Future<void> updatePublishingLayers(
    LocalTrack? track, List<lk_rtc.SubscribedQuality> layers) async {
  logger.fine('Update publishing layers: $layers');

  if (track?.sender == null) {
    logger.fine('Update publishing layers: sender is null');
    return;
  }

  final params = track?.sender?.parameters;
  if (params == null) {
    logger.fine('Update publishing layers: sender params are null');
    return;
  }

  final encodings = params.encodings;
  if (encodings == null) {
    logger.fine('Update publishing layers: encodings are null');
    return;
  }

  return setPublishingLayersForSender(track!.sender!, encodings, layers);
}