Skip to content

Commit

Permalink
fix(rtc): enable local video on camera testing (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Apr 21, 2021
1 parent ebf6ed2 commit 66bd999
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions desktop/renderer-app/src/apiMiddleware/Rtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export class Rtc {
height: 216,
width: 288,
});
this.rtcEngine.enableVideo();

if (channelType === RtcChannelType.Broadcast) {
if (isCreator) {
Expand Down Expand Up @@ -88,6 +89,7 @@ export class Rtc {
destroy(): void {
this.leave();
this.rtcEngine.removeAllListeners("tokenPrivilegeWillExpire");
this.rtcEngine.enableVideo();
}

private renewToken = async (): Promise<void> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ export const CameraCheckPage = (): React.ReactElement => {
width: 320,
height: 240,
});
rtcEngine.enableVideo();
rtcEngine.setupLocalVideo(cameraStream.current);
rtcEngine.enableLocalVideo(true);
rtcEngine.startPreview();
}

return () => {
rtcEngine.disableVideo();
rtcEngine.stopPreview();
};
}, [currentDeviceID, cameraStream, rtcEngine]);
Expand Down

0 comments on commit 66bd999

Please sign in to comment.