setVideoForwarding method

Future<bool> setVideoForwarding(
  1. VideoForwardingStrategy strategy,
  2. MaxVideoForwarding max,
  3. List<Participant> prioritizedParticipants
)

Sets the maximum number of video streams that may be transmitted to the local participant. For more information, see the Video Forwarding article.

This method uses the following parameters:

  • strategy: Defines how the SDK should select conference participants whose videos will be transmitted to the local participant. There are two possible values; the selection can be either based on the participants' audio volume or the distance from the local participant
  • max: The maximum number of video streams that may be transmitted to the local participant. The valid values are between 0 and 25. The default value is 4. In the case of providing a value smaller than 0 or greater than 25, SDK triggers an error.
  • prioritizedParticipants: The list of participants' objects. Allows prioritizing specific participant's video streams and display their videos even when these participants do not talk. For example, in the case of virtual classes, this option allows participants to pin the teacher's video and see the teacher, even when the teacher is not the active speaker.

Implementation

Future<bool> setVideoForwarding(
  VideoForwardingStrategy strategy,
  MaxVideoForwarding max,
  List<Participant> prioritizedParticipants,
) async {
  final result = await _methodChannel.invokeMethod<bool>(
    "setVideoForwarding",
    {
      "strategy": strategy.encode(),
      "max": max,
      "prioritizedParticipants":
          prioritizedParticipants.map((e) => e.toJson()).toList()
    },
  );
  return Future.value(result ?? false);
}