publishStreamVideo method

FutureOr<int> publishStreamVideo(
  1. BOOL publish
)

@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.

Implementation

FutureOr<int> publishStreamVideo(BOOL publish) async {
  return await nativeCall('publishStreamVideo:', [publish]);
}