Publish and Unpublish
When a user joins a room as a host, they need to publish resources so that other hosts and audience members in the room can see and hear them.
Publish
To publish an audio-video stream in a live streaming room, call the publish
method in RCRTCEngine
to broadcast local audio-video resources.
-
Sample code:
// Publish audio-video resources (microphone and camera data)
engine.publish(RCRTCMediaType.audio_video);
Unpublish
To stop publishing a live stream, call the unpublish
method in RCRTCEngine
to revoke local audio-video resources.
-
Sample code:
// Unpublish audio-video resources (microphone and camera data)
engine.unpublish(RCRTCMediaType.audio_video);