tencent cloud

Tencent Real-Time Communication

Web

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2023-09-26 17:01:08
This document describes how an anchor publishes audio/video streams. "Publishing" refers to turning on the mic and camera to make the audio heard and video seen by other users in the room.



Step 1. Enter Room

For detailed directions, see Enter Room.

Step 2. Turn on camera

Use the trtc.startLocalVideo() API to turn on the camera and publish it to the room.
// To preview the camera image, you need to place an HTMLElement in the DOM, which can be a div tag, assuming its id is local-video.
const view = 'local-video';
await trtc.startLocalVideo({ view });

Step 3. Turn on microphone

Use the trtc.startLocalAudio() API to turn on the microphone and publish it to the room.
await trtc.startLocalAudio();

Step 4. Turn off camera/microphone

Use the trtc.stopLocalVideotrtc.stopLocalAudio to turn off camera/microphone.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백