
// Set the rendering parameters of local preview: Flip the video horizontally and use the fill modeimport TRTCCloud, {TRTCRenderParams, TRTCVideoRotation,TRTCVideoFillMode, TRTCVideoMirrorType} from 'trtc-electron-sdk';const param = new TRTCRenderParams(TRTCVideoRotation.TRTCVideoRotation0,TRTCVideoFillMode.TRTCVideoFillMode_Fill,TRTCVideoMirrorType.TRTCVideoMirrorType_Auto);const rtcCloud = new TRTCCloud();rtcCloud.setLocalRenderParams(param);const cameraVideoDom = document.querySelector('.camera-dom');rtcCloud.startLocalPreview(cameraVideoDom);
quality. A higher quality isn't necessarily better. We recommend you set this parameter based on the application scenario.SPEECH or MUSIC.import { TRTCAudioQuality } from 'trtc-electron-sdk';// Enable mic capture and set `quality` to `SPEECH` (strong in noise suppression and adapts well to poor network conditions)rtcCloud.startLocalAudio(TRTCAudioQuality.TRTCAudioQualitySpeech);// Enable mic capture and set `quality` to `MUSIC` (high fidelity, minimum audio quality loss, recommended if a high-end sound card is used)rtcCloud.startLocalAudio(TRTCAudioQuality.TRTCAudioQualityMusic);
enterRoom), but in live streaming scenarios, you need to leave a certain amount of time for the anchor to test the mic and adjust the beauty filters; therefore, it is more common to turn on the camera and mic first and then enter a room.import { TRTCParams, TRTCRoleType, TRTCAppScene } from 'trtc-electron-sdk';// Assemble TRTC room entry parameters. Replace the field values in `TRTCParams` with your own parameter values// Replace each field in TRTCParams with your own parametersconst param = new TRTCParams();params.sdkAppId = 1400000123; // Replace with your own SDKAppIDparams.userId = "denny"; // Replace with your own user IDparams.roomId = 123321; // Replace with your own room numberparams.userSig = "xxx"; // Replace with your own userSigparams.role = TRTCRoleType.TRTCRoleAnchor;// If your scenario is live streaming, set the application scenario to `TRTC_APP_SCENE_LIVE`// If your application scenario is a group video call, use "TRTC_APP_SCENE_LIVE"rtcCloud.enterRoom(param, TRTCAppScene.TRTCAppSceneLIVE);
Feedback