@detail api
@valid since 3.60.
@brief Gets the call ID.
Call this method after joining a room. After creating a room, a call ID is generated to identify the call for this room.
@return Call ID.
@detail api
@author luomingkang
@brief Gets range audio instance.
@return API call result:
- ByteRTCRangeAudio: Success. You will get a ByteRTCRangeAudio{@link #ByteRTCRangeAudio} returned from the SDK.
- NULL: Failure. The current SDK does not offer range audio function.
@note The first time this API is called must be between creating a room and actually entering the room. Refer to Range Voice for more information.
@detail api
@author wangjunzheng
@brief Gets spatial audio instance.
@return API call result:
- ISpatialAudio: Success. You will get a ByteRTCSpatialAudio{@link #ByteRTCSpatialAudio} returned from the SDK.
- NULL: Failure. The current SDK does not offer spatial audio function.
@note
- The first time this API is called must be between you create a room and you actually enter the room. Refer to Spatial Audio for more information.
- Only using real dual-channel playback device can users actually enjoy spatial audio effect.
- Low-end device may have audio stalling issues due to its poor performance, so it is not recommended to enable spatial audio function on such kind of devices.
- SDK currently supports up to 30 users publishing audio with spatial audio enabled at the same time in the same room.
@detail api
@author shenpengliang
@brief Join the RTC room.
After creating a room by calling createRTCRoom:{@link #ByteRTCEngine#createRTCRoom}, call this API to join the room and make audio & video calls with other users in the room.
@param token Dynamic key for authentication and verification of users entering the room.
You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. See Authentication with Token for token validity and generation method.
Apps with different AppIDs are not interoperable.
Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail.
@param userInfo User information. See ByteRTCUserInfo{@link #ByteRTCUserInfo}.
@param userVisibility User visibility. We recommend setting the user visibility to false when entering the room, and then setting it to true via setUserVisibility:{@link #ByteRTCRoom#setUserVisibility} when the user needs to send audio & video streams. Joining fails when the number of users in an RTC room reaches the upper limit. An RTC room can accommodate a maximum of 50 visible users, and 30 media streams can be published simultaneously. For more information, see Capability of Users and Streams.
@param roomConfig Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow. See ByteRTCRoomConfig{@link #ByteRTCRoomConfig} for the specific configuration mode.
@return Method call result.
- 0: Success.
- Local users receive notifications of the room state via rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo}.
- Local users receive notifications of the local-stream state via rtcRoom:onVideoPublishStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoPublishStateChanged:info:state:reason}, rtcRoom:onAudioPublishStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioPublishStateChanged:info:state:reason}.
- Local users receive notifications of the subscribed-stream state via rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}, rtcRoom:onAudioSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioSubscribeStateChanged:info:state:reason}, rtcRoom:onScreenVideoSubscribeStateChanged:userId:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onScreenVideoSubscribeStateChanged:userId:state:reason}, and/or rtcRoom:onScreenAudioSubscribeStateChanged:userId:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onScreenAudioSubscribeStateChanged:userId:state:reason}.
- Local users receive notifications of the published-stream state via rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish}, rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish}.
- If the local user is also a visible user, the other participants receive rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined} callback.
- -1: Invalid parameter
- -2: Already in the room. After the interface call is successful, as long as the return value of 0 is received and leaveRoom{@link #ByteRTCRoom#leaveRoom} is not called successfully, this return value will be triggered when the room entry interface is called again, regardless of whether the filled room ID and user ID are duplicated.
The reason for the failure will be communicated via the rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo} callback.
@note
- In the same room with the same AppID, the user ID of each user must be unique. If two users have the same user ID, the user who joined the room later will kick the user who joined the room first out of the room, and the user who joined the room first will receive rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo} callback notification, the error type is duplicate login ByteRTCErrorCodeDuplicateLogin.
- Local users will receive rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo} callback notification after calling this method to join the room successfully. If the local user is also a visible user, the remote user will receive an rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined} callback notification when joining the room.
- By default, the user is visible in an RTC room. Joining fails when the number of users in an RTC room reaches its upper limit. To avoid this, call setUserVisibility:{@link #ByteRTCRoom#setUserVisibility} to change the visibility of the audience users to false by considering the capacity for the invisible users is much larger than that for visible users. An RTC room can accommodate a maximum of 50 visible users, and 30 media streams can be published simultaneously. For more information, see Capability of Users and Streams.
- After the user successfully joins the room, the SDK may lose connection to the server in case of poor local network conditions. At this time rtcEngine:onConnectionStateChanged:{@link #ByteRTCEngineDelegate#rtcEngine:onConnectionStateChanged} callback will be triggered and the SDK will automatically retry until it successfully reconnects to the server. After successful reconnection, you will receive a callback notification from rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo} locally.
@detail api
@brief Joins an RTS room.
After creating a room by calling createRTSRoom:{@link #ByteRTCEngine#createRTSRoom}, call this API to join the room and make audio & video calls with other users in the room.
@param token Dynamic key for authentication and verification of users entering the room.
You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. See Authentication with Token for token validity and generation method.
Apps with different AppIDs are not interoperable.
Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail.
@param userInfo User information. See ByteRTCUserInfo{@link #ByteRTCUserInfo}.
@return Method call result.
- 0: Success.
- Local users receive notifications of the room state via rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo}.
- -1: Invalid parameter
- -2: Already in the room. After the interface call is successful, as long as the return value of 0 is received and leaveRoom{@link #ByteRTCRoom#leaveRoom} is not called successfully, this return value will be triggered when the room entry interface is called again, regardless of whether the filled room ID and user ID are duplicated.
The reason for the failure will be communicated via the rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} callback.
@note
- In the same room with the same AppID, the user ID of each user must be unique. If two users have the same user ID, the user who joined the room later will kick the user who joined the room first out of the room, and the user who joined the room first will receive rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} callback notification, the error type is duplicate login ByteRTCErrorCodeDuplicateLogin.
- Local users will receive rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} callback notification after calling this method to join the room successfully. If the local user is also a visible user, the remote user will receive an rtsRoom:onUserJoined:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserJoined} callback notification when joining the room.
- After the user successfully joins the room, the SDK may lose connection to the server in case of poor local network conditions. At this time rtcEngine:onConnectionStateChanged:{@link #ByteRTCEngineDelegate#rtcEngine:onConnectionStateChanged} callback will be triggered and the SDK will automatically retry until it successfully reconnects to the server. After successful reconnection, you will receive a callback notification from rtsRoom:onUserJoined:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserJoined} locally.
@detail api
@author shenpengliang
@brief Leaves the RTC room.
The user calls this method to leave the room, end the call process, and release all call-related resources.
@return
- 0: Success. If the user is a host:
- The other participants receive rtcRoom:onUserLeave:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onUserLeave:reason} callback.
- The publishing streams stop and the other participants receive notifications of the stream states via rtcRoom:onVideoPublishStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoPublishStateChanged:info:state:reason}, rtcRoom:onAudioPublishStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioPublishStateChanged:info:state:reason}.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- After the user leaves the room, the local will receive a callback for rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo};
- Call setUserVisibility:{@link #ByteRTCRoom#setUserVisibility} method sets itself to be visible. After the user leaves the room, other users in the room will receive rtcRoom:onUserLeave:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onUserLeave:reason} callback notification.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the pauseAllSubscribedStream method for the below functions. If you have upgraded to version 3.60 or later and are still using this method, please migrate to this interface.
@author shenpengliang
@brief Pauses receiving all remote audio streams.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- Calling this API does not change the capture and transmission state of the remote stream.
- Calling this API does not cancel the subscription or change any subscription configuration.
- To resume receiving streams, call resumeAllSubscribedStreamVideo{@link #ByteRTCRoom#resumeAllSubscribedStreamVideo}.
- In a multi-room scenario, this API only pauses the reception of streams published in the current room.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the pauseAllSubscribedStream method for the below functions. If you have upgraded to version 3.60 or later and are still using this method, please migrate to this interface.
@author shenpengliang
@brief Pauses receiving all remote video streams.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- Calling this API does not change the capture and transmission state of the remote stream.
- Calling this API does not cancel the subscription or change any subscription configuration.
- To resume receiving streams, call resumeAllSubscribedStreamVideo{@link #ByteRTCRoom#resumeAllSubscribedStreamVideo}.
- In a multi-room scenario, this API only pauses the reception of streams published in the current room.
@detail api
@region Multi-room
@author shenpengliang
@brief Pauses relaying media stream to all rooms after calling startForwardStreamToRooms:{@link #ByteRTCRoom#startForwardStreamToRooms}.
After that, call resumeForwardStreamToAllRooms{@link #ByteRTCRoom#resumeForwardStreamToAllRooms} to resume.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note The other users in the room will receive callback of rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish}, rtcRoom:onUserPublishStreamAudio:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamAudio:info:isPublish} when you pause relaying.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the publishStream and unpublishStream methods for the following functions. If you have upgraded to version 3.60 or above and are still using these two methods, please migrate to this interface.
@brief Publishes or stops publishing media streams captured by the local microphone in the current room.
@param publish Whether to publish the media stream.
- true: Publish.
- false: Stop publishing.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- You don't need to call this API if you set it to Auto-publish when calling joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig}.
- An invisible user cannot publish media streams. Call setUserVisibility:{@link #ByteRTCRoom#setUserVisibility} to change your visibility in the room.
- Call publishStreamVideo:{@link #ByteRTCRoom#publishStreamVideo} to start or stop publishing the video stream captured by the camera.
- Call startForwardStreamToRooms:{@link #ByteRTCRoom#startForwardStreamToRooms} to forward the published streams to the other rooms.
- After you call this API, the other users in the room will receive rtcRoom:onUserPublishStreamAudio:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamAudio:info:isPublish}. Those who successfully received your streams will receive rtcEngine:onFirstRemoteAudioFrame:info:{@link #ByteRTCEngineDelegate#rtcEngine:onFirstRemoteAudioFrame:info} at the same time.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the publishStream and unpublishStream methods for the following functions. If you have upgraded to version 3.60 or above and are still using these two methods, please migrate to this interface.
@brief Publishes or stops publishing video streams captured by the local camera in the current room.
@param publish Whether to publish the video stream.
- true: Publish.
- false: Stop publishing.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- You don't need to call this API if you set it to Auto-publish when calling joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig}.
- An invisible user cannot publish media streams. Call setUserVisibility:{@link #ByteRTCRoom#setUserVisibility} to change your visibility in the room.
- Call publishStreamAudio:{@link #ByteRTCRoom#publishStreamAudio} to start or stop publishing the audio stream captured by the microphone.
- Call startForwardStreamToRooms:{@link #ByteRTCRoom#startForwardStreamToRooms} to forward the published streams to the other rooms.
- After you call this API, the other users in the room will receive rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish}. Those who successfully received your streams will receive rtcEngine:onFirstRemoteVideoFrameDecoded:info:withFrameInfo:{@link #ByteRTCEngineDelegate#rtcEngine:onFirstRemoteVideoFrameDecoded:info:withFrameInfo} at the same time.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the resumeAllSubscribedStream method for the below functions. If you have upgraded to version 3.60 or later and are still using this method, please migrate to this interface.
@author shenpengliang
@brief Resumes receiving all remote audio streams.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note
- Calling this API does not change the capture and transmission state of the remote stream.
- Calling this API does not change any subscription configuration.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the resumeAllSubscribedStream method for the below functions. If you have upgraded to version 3.60 or later and are still using this method, please migrate to this interface.
@author shenpengliang
@brief Resumes receiving all remote audio streams.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- Calling this API does not change the capture and transmission state of the remote stream.
- Calling this API does not change any subscription configuration.
@detail api
@author shenpengliang
@brief Resumes relaying media streams paused by calling pauseForwardStreamToAllRooms{@link #ByteRTCRoom#pauseForwardStreamToAllRooms} to all rooms.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note The other users in the room will receive callback of rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined} and rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined} when you resume relaying.
@detail api
@author hanchenchen.c
@brief Sends binary messages to all other users in the room.
@param message
The binary broadcast message sent by the user
The message does not exceed 46KB.
@return The number of the message sent this time is incremented from 1.
@note
- Before broadcasting binary messages in the room, you must call joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig} to join the room.
- After calling this function, you will receive an rtcRoom:onRoomMessageSendResult:error:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomMessageSendResult:error} callback to notify the sender of the success or failure of the message;
- If the binary message is successfully sent, all users in the room will receive rtcRoom:onRoomBinaryMessageReceived:message:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomBinaryMessageReceived:message} callback.
@detail api
@author hanchenchen.c
@brief Sends text messages to all other users in the room.
@param message
The content of the text message sent.
Message does not exceed 64 KB.
@return The number of the message sent this time is incremented from 1.
@note
- Before sending an in-room text message, you must call joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig} to join the room.
- After calling this function, you will receive an rtcRoom:onRoomMessageSendResult:error:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomMessageSendResult:error} callback to notify the sender of the success or failure of the message;
- If the text message is sent successfully, all remote users in the room will receive rtcRoom:onRoomMessageReceived:message:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomMessageReceived:message} callback.
@detail The api
@brief Sends a binary message (P2P) to the specified user in the room.
@param uid
Message Receiving user's ID
@param message
Binary message content sent
Message does not exceed 46KB.
@param config See ByteRTCMessageConfig{@link #ByteRTCMessageConfig}.
@return The number of the message sent this time is incremented from 1.
@note
- Before sending the in-room binary message, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room.
- After calling this function, you will receive an rtsRoom:onUserMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageSendResult:error} callback to notify the sender of the success or failure of the message;
- If the binary message is sent successfully, the user specified by uid will receive rtsRoom:onUserBinaryMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserBinaryMessageReceived:message} callback.
@detail api
@brief Sends a text message (P2P) to the specified user in the room.
@param userId ID of the user receiving the message
@param message Message content of which the length must not exceed 64 KB.
@param config Reliability of the message.
@return The number of the message sent this time is incremented from 1.
@note
- Before sending an in-room text message, you must call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to join the room.
- After calling this API, you will receive an rtsRoom:onUserMessageSendResult:error:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageSendResult:error} callback to notify the sender of the success or failure of the message.
- If the text message is sent successfully, the user specified by uid will receive an rtsRoom:onUserMessageReceived:message:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onUserMessageReceived:message} callback.
@valid since 3.52.
@detail api
@author yejing.luna
@brief Set the priority of the local audio stream to be published.
@param audioSelectionPriority The priority of the local audio stream which defaults to be subscribable only up to the result of the Audio Selection. Refer to ByteRTCAudioSelectionPriority{@link #ByteRTCAudioSelectionPriority}.
@note
You must enable Audio Selection in the RTC console before using this API. You can call this API whether the user has joined a room. Refer to Audio Selection.
The setting is independent in each room that the user joins.
@detail api
@author wangzhanqiang
@brief Synchronizes published audio and video.
When the same user simultaneously uses separate devices to capture and publish audio and video, there is a possibility that the streams are out of sync due to the network disparity. In this case, you can call this API on the video publisher side and the SDK will automatically line the video stream up according to the timestamp of the audio stream, ensuring that the audio the receiver hears corresponds to the video the receiver watches.
@param audioUserId The ID of audio publisher. You can stop the current A/V synchronization by setting this parameter to null.
@return
- 0: Success. When the A/V synchronization state changes, you will receive rtcRoom:onAVSyncStateChange:{@link #ByteRTCRoomDelegate#rtcRoom:onAVSyncStateChange}.
- < 0 : Fail. Learn more details via rtcRoom:onAVSyncEvent:userId:eventCode:{@link #ByteRTCRoomDelegate#rtcRoom:onAVSyncEvent:userId:eventCode}. More than one pair of audio and video can be synchronized simultaneously in the same RTC room, but you should note that one single audio source cannot be synchronized with multiple video sources at the same time.
@note
- You can call this API anytime before or after entering the room.
- The source user IDs of the audio and video stream to be synchronized must be in the same RTC room.
- If you want to change the audio source, call this API again with a new audioUserId. If you want to change the video source, you need to stop the current synchronization first, then call this API on the new video publisher side.
@detail api
@author zhangcaining
@brief Adjusts the audio playback volume from all the remote users in a room.
@param volume Ratio(%) of playback volume to original volume, in the range 0, 400, with overflow protection.
To ensure the audio quality, we recommend setting the volume to 100.
- 0: mute
- 100: original volume. Default value.
- 400: Up to 4 times the original volume (with overflow protection)
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@note Suppose a remote user A is always within the range of the target user whose playback volume will be adjusted,
- If you use both this method and setRemoteAudioPlaybackVolume:volume:{@link #ByteRTCEngine#setRemoteAudioPlaybackVolume:volume}, the volume that the local user hears from user A is the volume set by the method called later.
- If you use both this method and setPlaybackVolume:{@link #ByteRTCEngine#setPlaybackVolume}, the volume that the local user hears from user A is the overlay of both settings.
@detail api
@valid since 3.60.
@brief Sets the type of the remote video stream to subscribe to.
@param streamId ID of the remote video stream you expect to subscribe to.
@param streamType Video stream type, see ByteRTCVideoSimulcastStreamType{@link #ByteRTCVideoSimulcastStreamType}.
@return API call result:
- 0: Success.
- <0: Failure.
@note
- This API only works after the publisher calls setVideoEncoderConfig:withParameters:{@link #ByteRTCEngine#setVideoEncoderConfig:withParameters} to enable publishing multiple-quality video streams, in which case the subscriber will receive the stream from the publisher that is closest to the set configuration; otherwise the subscriber will only receive one video stream with a resolution of 640px × 360px and a frame rate of 15fps.
- If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive by default the video stream with the largest resolution set by the publisher.
- This API only affects camera video streams published by remote users.
@detail api
@brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
@param streamId ID of the remote video stream you want to configure subscription parameters for.
@param remoteVideoConfig Parameters you want to configure for the remote video stream, see ByteRTCRemoteVideoConfig{@link #ByteRTCRemoteVideoConfig}.
@return API call result:
+ 0: Success.
+ !0: Failure.
@note
+ This API only works after the publisher calls setLocalSimulcastMode:{@link #ByteRTCEngine#setLocalSimulcastMode} to enable publishing multiple video streams, in which case the subscriber will receive the stream from the publisher that is closest to the set configuration; otherwise the subscriber will only receive one video stream with a resolution of 640px × 360px and a frame rate of 15fps..
+ If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive by default the video stream with the largest resolution set by the publisher.
+ You should call this API in the room.
+ SDK will automatically select the stream to be published or subcribed based on the settings of both sides see for details.
@valid since 3.52.
@detail api
@author lichangfeng.rtc
@brief Sets extra information about the room the local user joins.
@param key Key of the extra information, less than 10 bytes in length.
A maximum of 5 keys can exist in the same room, beyond which the first key will be replaced.
@param value Content of the extra information, less than 128 bytes in length.
@return API call result:
- 0: Success with a taskId returned.
- <0: Failure. See ByteRTCSetRoomExtraInfoResult{@link #ByteRTCSetRoomExtraInfoResult} for the reasons.
@note
- Call joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig} first before you call this API to set extra information.
- After calling this API, you will receive rtcRoom:onSetRoomExtraInfoResult:result:{@link #ByteRTCRoomDelegate#rtcRoom:onSetRoomExtraInfoResult:result} callback informing you the result of the setting.
- After the extra information is successfully set, other users in the same room will receive the information through rtcRoom:onRoomExtraInfoUpdate:value:lastUpdateUserId:lastUpdateTimeMs:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomExtraInfoUpdate:value:lastUpdateUserId:lastUpdateTimeMs} callback.
- Users who join the room later will be notified of all extra information in the room set prior to entering.
@detail api
@author shenpengliang
@brief Listens for event callbacks related to the ByteRTCRoom{@link #ByteRTCRoom} instance by setting the event handler of this instance.
@param roomDelegate Refer to ByteRTCRoomDelegate{@link #ByteRTCRoomDelegate}.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@detail api
@brief By setting ByteRTCRTSRoomDelegate{@link #ByteRTCRTSRoomDelegate}, you can get infromed of events realted to this ByteRTCRTSRoom object.
@param roomDelegate Refer to ByteRTCRTSRoomDelegate{@link #ByteRTCRTSRoomDelegate}.
@return
+ 0: Success.
+ < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details
@detail api
@region Stream Management
@brief Sets extra information about the stream the local user publishes.
@param extra_info Extra information of the stream. The length does not exceed 1024 bytes.
@return
- 0: Success.
- < 0: Failure.
@note
- You can use this function to set extra information about the stream the local user publishes. Stream extra information is an additional information attached to the stream ID. Unlike the stream ID, the stream extra information can be modified during the publishing of the corresponding stream ID. Developers can use the stream extra information to synchronize the content of the stream ID with the corresponding stream ID.
- You can call this API before or after you call joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig}.
- Other users in the same room will receive the notification through rtcRoom:onRoomStreamExtraInfoUpdate:info:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStreamExtraInfoUpdate:info:extraInfo}.
@detail api
@author shenpengliang
@brief Set the visibility of the user in the room. The local user is visible to others by default before calling this API.
An RTC room can accommodate a maximum of 50 visible users, and 30 media streams can be published simultaneously. For more information, see Room Capacity.
@param enable Visibility of the user in the room.
- YES: The user can publish media streams. The other users in the room get informed of the behaviors of the user, such as joining room, starting video capture, and leaving room.
- NO: The user cannot publish media streams. The other users in the room do not get informed of the behaviors of the user, such as joining room, starting video capture, or leaving room.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
You will receive rtcRoom:onUserVisibilityChanged:errorCode:{@link #ByteRTCRoomDelegate#rtcRoom:onUserVisibilityChanged:errorCode} after calling this API. (Available since v3.54)
- If you call this API before joining room, and the set value is different from the default value, you will receive the callback when you join the room.
- If you call this API after joining room, and the current visibility is different from the previous value, you will receive the callback.
- When reconnecting after losing internet connection, if the visibility changes, you will receive the callback.
@note
- You can call this API whether the user is in a room or not.
- When you call this API while you are in the room, the other users in the room will be informed via the following callback.
• When you switch from false to true, they will receive rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined}.
• When you switch from true to false, they will receive rtcRoom:onUserLeave:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onUserLeave:reason}.
• The invisible user will receive the warning code, ByteRTCWarningCodeSubscribeStreamForbiden, when trying to publish media streams.
@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.
@hidden currently not available
@detail api
@author qiaoxingwang
@brief Recognizes or translates the speech of all speakers in the room and converts the results into captions.
When calling this method, you can choose the subtitle mode in the ByteRTCSubtitleMode{@link #ByteRTCSubtitleMode}. If you choose the recognition mode, you will receive the rtcRoom:onSubtitleMessageReceived:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleMessageReceived} callback which contains the transcribed text.
If you choose the translation mode, you will receive two rtcRoom:onSubtitleMessageReceived:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleMessageReceived} callbacks simultaneously, one contains the transcribed text and the other contains the translated text.
After calling this method, you will receive the rtcRoom:onSubtitleStateChanged:errorCode:errorMessage:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleStateChanged:errorCode:errorMessage} to inform you of whether subtitles are on.
@param subtitleConfig Subtitle configurations. Refer to ByteRTCSubtitleConfig{@link #ByteRTCSubtitleConfig} for details.
@return
- 0: Success.
- < 0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- Call this method after joining the room.
- You can set your source language to Chinese by calling joinRoom and importing a json formatted string "source_language": "zh" through the parameter of extraInfo, to English by importing "source_language": "en" , and to Japanese by importing "source_language": "ja" . If you don't set the source language, SDK will set the language of your system as the source language. If the language of your system is not Chinese, English or Japanese, SDK will set Chinese as the source language.
@detail api
@author shenpengliang
@brief Stops relaying media stream to all rooms after calling startForwardStreamToRooms:{@link #ByteRTCRoom#startForwardStreamToRooms}.
@return
- 0: Success.
- < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- Calling this method will trigger rtcRoom:onForwardStreamStateChanged:{@link #ByteRTCRoomDelegate#rtcRoom:onForwardStreamStateChanged}.
- The other users in the room will receive callback of rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined} and rtcRoom:onUserJoined:{@link #ByteRTCRoomDelegate#rtcRoom:onUserJoined} when you stop relaying.
- To stop relaying media stream to specific rooms, call updateForwardStreamToRooms:{@link #ByteRTCRoom#updateForwardStreamToRooms} instead.
- To pause the relaying for a short time, call pauseForwardStreamToAllRooms{@link #ByteRTCRoom#pauseForwardStreamToAllRooms}, and then call resumeForwardStreamToAllRooms{@link #ByteRTCRoom#resumeForwardStreamToAllRooms} to recsume after that.
@hidden currently not available
@detail api
@author qiaoxingwang
@brief Turns off subtitles.
After calling this method, you will receive the rtcRoom:onSubtitleStateChanged:errorCode:errorMessage:{@link #ByteRTCRoomDelegate#rtcRoom:onSubtitleStateChanged:errorCode:errorMessage} to inform you of whether subtitles are off.
@return
- 0: Success.
- !0: Failure.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the subscribeAllStreams and unsubscribeAllStreams methods for the below functions. If you have upgraded to version 3.60 or later and are still using these methods, please migrate to this interface.
@author yejing.luna
@brief Subscribes to or unsubscribes from all remote audio streams (captured by microphone).
@param subscribe Whether to subscribe to all remote audio streams.
- true: Subscribe.
- false: Unsubscribe.
@return API call result:
- 0: Success.
- < 0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
- If the subscription options conflict with the previous ones, they are subject to the configurations in the last call.
- In the Audio selection, if the number of media streams exceeds the limit, we recommend you call subscribeStreamAudio:subscribe:{@link #ByteRTCRoom#subscribeStreamAudio:subscribe} to subscribe each target media stream other than calling this API.
- After calling this API, you will be informed of the calling result with rtcRoom:onAudioSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioSubscribeStateChanged:info:state:reason}.
- Once the local user subscribes to the stream of a remote user, the subscription to the remote user will sustain until the local user leaves the room or unsubscribe from it by calling subscribeStreamAudio:subscribe:{@link #ByteRTCRoom#subscribeStreamAudio:subscribe}.
- Any other exceptions will be included in rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo}, see ByteRTCErrorCode{@link #ByteRTCErrorCode} for the reasons.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the subscribeAllStreams and unsubscribeAllStreams methods for the below functions. If you have upgraded to version 3.60 or later and are still using these methods, please migrate to this interface.
@author yejing.luna
@brief Subscribes to or unsubscribes from all remote video streams captured by camera.
@param subscribe Whether to subscribe to the video stream.
- true: Subscribe.
- false: Unsubscribe.
@return API call result:
- 0: Success
- !0: Failure
@note
- If the subscription options conflict with the previous ones, they are subject to the configurations in the last call.
- In the Audio selection, if the number of media streams exceeds the limit, we recommend you call subscribeAllStreamsVideo:{@link #ByteRTCRoom#subscribeAllStreamsVideo} to subscribe each target media stream other than calling this API.
- After calling this API, you will be informed of the calling result with rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}.
- Once the local user subscribes to the stream of a remote user, the subscription to the remote user will sustain until the local user leaves the room or unsubscribe from it by calling subscribeAllStreamsVideo:{@link #ByteRTCRoom#subscribeAllStreamsVideo}.
- Any other exceptions will be included in rtcRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRoomDelegate#rtcRoom:onRoomStateChanged:withUid:state:extraInfo}, see ByteRTCErrorCode{@link #ByteRTCErrorCode} for the reasons.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the subscribeStream:mediaStreamType: and unsubscribeStream:mediaStreamType: methods for the below functions. If you have upgraded to version 3.60 or later and are still using these methods, please migrate to this interface.
@brief Subscribes to or unsubscribes from specific remote audio streams captured by the local microphone.
@param streamId The ID of the target remote audio stream.
@param subscribe Whether to subscribe to the audio stream.
- true: Subscribe.
- false: Unsubscribe.
@return API call result:
- 0: Success.
- <0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for specific reasons.
@note
- Calling this API to update the subscribe configuration when the user has subscribed the remote user either by calling this API or by auto-subscribe.
- You must first get the remote stream information through rtcRoom:onUserPublishStreamAudio:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamAudio:info:isPublish} before calling this API to subscribe to streams accordingly.
- After calling this API, you will be informed of the calling result with rtcRoom:onAudioSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioSubscribeStateChanged:info:state:reason}.
- Once the local user subscribes to the stream of a remote user, the subscription to the remote user will sustain until the local user leaves the room or unsubscribe from it by calling subscribeStreamAudio:subscribe:{@link #ByteRTCRoom#subscribeStreamAudio:subscribe}.
- Any other exceptions will be included in rtcRoom:onAudioSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioSubscribeStateChanged:info:state:reason}.
@detail api
@valid since 3.60. Since version 3.60, this interface replaces the subscribeStream:mediaStreamType: and unsubscribeStream:mediaStreamType: methods for the below functions. If you have upgraded to version 3.60 or later and are still using these methods, please migrate to this interface.
@brief Subscribes to or unsubscribes from specific remote video streams captured by the local camera.
@param streamId The ID of the target remote video stream.
@param subscribe Whether to subscribe to the video stream.
- true: Subscribe.
- false: Unsubscribe.
@return API call result:
- 0: Success.
- <0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for specific reasons.
@note
- Calling this API to update the subscribe configuration when the user has subscribed the remote user either by calling this API or by auto-subscribe.
- You must first get the remote stream information through rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish} before calling this API to subscribe to streams accordingly.
- After calling this API, you will be informed of the calling result with rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}.
- Once the local user subscribes to the stream of a remote user, the subscription to the remote user will sustain until the local user leaves the room or unsubscribe from it by calling this method to cancel.
- Any other exceptions will be included in rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}, see ByteRTCSubscribeStateChangeReason{@link #ByteRTCSubscribeStateChangeReason} for the reasons.
@detail api
@author shenpengliang
@brief Updates information of the rooms where you want to relay the media stream to after calling startForwardStreamToRooms:{@link #ByteRTCRoom#startForwardStreamToRooms}.
Adding and removing rooms by calling this method will trigger rtcRoom:onForwardStreamStateChanged:{@link #ByteRTCRoomDelegate#rtcRoom:onForwardStreamStateChanged} on the local.
@param configurations Information of the rooms where you want to relay the media stream to. Refer to ByteRTCForwardStreamConfiguration{@link #ByteRTCForwardStreamConfiguration} for more information.
@return
- 0: Success.
- < 0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details.
@note
Users in the room which is added or removed from the target list by calling this method will receive 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}.
@detail api
@brief Update Token.
You must call this API to update token to ensure the RTC call to continue when you receive onTokenWillExpire:{@link #ByteRTCRoomDelegate#onTokenWillExpire}, onPublishPrivilegeTokenWillExpire:{@link #ByteRTCRoomDelegate#onPublishPrivilegeTokenWillExpire}, or onSubscribePrivilegeTokenWillExpire:{@link #ByteRTCRoomDelegate#onSubscribePrivilegeTokenWillExpire}.
@param token Valid token.
If the Token is invalid, you will receive rtsRoom:onRoomStateChanged:withUid:state:extraInfo:{@link #ByteRTCRTSRoomDelegate#rtsRoom:onRoomStateChanged:withUid:state:extraInfo} with the error code of -1010.
@return
- 0: Success
- !0: Failure
@note
- In versions before 3.50, the publish and subscribe privileges contained in the Token are reserved parameters with no actual control permissions. In version 3.50 and later, the publish/subscribe privileges will be effective for whitelisted users. Please contact the technical support team to include you in the whitelist if you need this function.
- Do not call both updateToken:{@link #ByteRTCRTSRoom#updateToken} and joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} to update the Token. If you fail to join the room or have been removed from the room due to an expired or invalid Token, call joinRTSRoom:userInfo:{@link #ByteRTCRTSRoom#joinRTSRoom:userInfo} with a valid token to rejoin the room.