This document describes how to subscribe to the audio/video streams of another user (remote user) in the room, i.e., how to play the audio/video of a remote user.
Step 1. Enter Room
Step 2. Play Remote Audio and Video
Play Remote Audio
By default, the SDK will automatically play remote audio, and you do not need to call any API to play remote audio.
If you do not want the SDK to automatically play remote audio, you can
3. Save the userId of remote user when this event fired.
Play Remote Video
trtc.on(TRTC.EVENT.REMOTE_VIDEO_AVAILABLE, ({ userId, streamType }) => {
const view = `${userId}_${streamType}`;
trtc.startRemoteVideo({ userId, streamType, view });
});
Was this page helpful?