updateForwardStreamToRooms method

Future<int?> updateForwardStreamToRooms(
  1. List<ForwardStreamInfo> forwardStreamInfos
)

@detail api @author shenpengliang @brief Update information of the rooms where you want to relay the media stream to after calling startForwardStreamToRooms{@link #RTCRoom#startForwardStreamToRooms}.
Adding and removing rooms by calling this method will trigger onForwardStreamStateChanged{@link #IRTCRoomEventHandler#onForwardStreamStateChanged} on the local. @param forwardStreamInfos Information of the rooms where you want to relay the media stream to. Refer to ForwardStreamInfo{@link #ForwardStreamInfo} for more information. @return - 0: Success. - < 0: Failure. See ReturnStatus{@link #ReturnStatus} for more details. @note Users in the room which is added or removed from the target list by calling this method will receive onUserJoined{@link #IRTCRoomEventHandler#onUserJoined}, onUserPublishStreamVideo{@link #IRTCRoomEventHandler#onUserPublishStreamVideo}, onUserPublishStreamAudio{@link #IRTCRoomEventHandler#onUserPublishStreamAudio}.

Implementation

Future<int?> updateForwardStreamToRooms(
    List<ForwardStreamInfo> forwardStreamInfos) async {
  $a() => ($instance as $p_a.RTCRoom).updateForwardStreamToRooms(
      forwardStreamInfos
          .map(($item) => unpackObject<$p_a.ForwardStreamInfo>($item))
          .toList());
  $i() => ($instance as $p_i.ByteRTCRoom).updateForwardStreamToRooms(
      forwardStreamInfos
          .map(($item) =>
              unpackObject<$p_i.ByteRTCForwardStreamConfiguration>($item))
          .toList());

  if (Platform.isAndroid) {
    return $a();
  } else if (Platform.isIOS) {
    return $i();
  } else {
    throw UnsupportedError(
        'Not Support Platform ${Platform.operatingSystem}');
  }
}