startForwardStreamToRooms method
- NSArray<
ByteRTCForwardStreamConfiguration> configurations
@detail api
@author shenpengliang
@brief Starts relaying media stream across rooms.
After calling joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig}, call this API to achieve the relaying of media streams to multiple rooms, which applies to cross-room concatenation and other scenarios.
@param configurations Information of the rooms where you want to relay the media stream to. Refer to ByteRTCForwardStreamConfiguration{@link #ByteRTCForwardStreamConfiguration} for more inforamtion.
@return
- 0: Success.
- < 0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- Calling this method will trigger rtcRoom:onForwardStreamStateChanged:{@link #ByteRTCRoomDelegate#rtcRoom:onForwardStreamStateChanged}.
- After calling this method, listen the events from each room during the relaying by registering rtcRoom:onForwardStreamEvent:{@link #ByteRTCRoomDelegate#rtcRoom:onForwardStreamEvent}.
- Once the relaying begins, the other users in the room will receive callback of rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined}, rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish}, rtcRoom:onUserPublishStreamAudio:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamAudio:info:isPublish}.
- Call updateForwardStreamToRooms:{@link #ByteRTCRoom#updateForwardStreamToRooms} to add or remove the designated room(s) after calling this method.
- Call stopForwardStreamToRooms{@link #ByteRTCRoom#stopForwardStreamToRooms} to stop relaying to all rooms after calling this method.
- Call pauseForwardStreamToAllRooms{@link #ByteRTCRoom#pauseForwardStreamToAllRooms} to pause relaying to all rooms after calling this method.
Implementation
FutureOr<int> startForwardStreamToRooms(
NSArray<ByteRTCForwardStreamConfiguration> configurations) async {
return await nativeCall('startForwardStreamToRooms:', [configurations]);
}