startForwardStreamToRooms method
@detail api
@author shenpengliang
@brief Start relaying media stream across rooms.
After calling joinRoom{@link #RTCRoom#joinRoom}, you can call this method to publish the media stream to multiple rooms that applies to scenarios such as an online talent contest and so on.
@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
- Call this method will trigger onForwardStreamStateChanged{@link #IRTCRoomEventHandler#onForwardStreamStateChanged}.
- After calling this method, listen the events from each room during the relaying by registering onForwardStreamEvent{@link #IRTCRoomEventHandler#onForwardStreamEvent}.
- Once the relaying begins, the other users in the room will receive callback of onUserJoined{@link #IRTCRoomEventHandler#onUserJoined}, onUserPublishStreamVideo{@link #IRTCRoomEventHandler#onUserPublishStreamVideo}, onUserPublishStreamAudio{@link #IRTCRoomEventHandler#onUserPublishStreamAudio}.
- Call updateForwardStreamToRooms{@link #RTCRoom#updateForwardStreamToRooms} to add or remove the designated room(s) after calling this method.
- Call stopForwardStreamToRooms{@link #RTCRoom#stopForwardStreamToRooms} to stop relaying to all rooms after calling this method.
- Call pauseForwardStreamToAllRooms{@link #RTCRoom#pauseForwardStreamToAllRooms} to pause relaying to all rooms after calling this method.
Implementation
FutureOr<int> startForwardStreamToRooms(
List<ForwardStreamInfo> forwardStreamInfos) async {
return await nativeCall('startForwardStreamToRooms', [forwardStreamInfos]);
}