Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private startRtc = (uid: number, channelId: string): void => {
this.setSliderExtending();
this.setState({isStartBtnLoading: true});
if (!this.agoraClient) {
this.agoraClient = AgoraRTC.createClient({mode: "live", codec: "h264"});
this.agoraClient.init(this.props.agoraAppId, () => {
console.log("AgoraRTC client initialized");
}, (err: any) => {
console.log("AgoraRTC client init failed", err);
});
}
const localStream = AgoraRTC.createStream({
streamID: uid,
audio: true,
video: true,
screen: false,
});
localStream.init(() => {
console.log("getUserMedia successfully");
this.setState({localStream: localStream});
localStream.play("rtc_local_stream");
private startRtc = (userId: number, channelId: string): void => {
this.agoraClient = AgoraRTC.createClient({mode: "rtc", codec: "h264"});
this.agoraClient.init(this.props.agoraAppId, () => {
console.log("AgoraRTC client initialized");
}, (err: any) => {
console.log("AgoraRTC client init failed", err);
});
const localStream = AgoraRTC.createStream({
streamID: userId,
audio: true,
video: true,
});
localStream.init(() => {
console.log("getUserMedia successfully");
const netlessLocalStream = {
...localStream,
state: {isVideoOpen: true, isAudioOpen: true},
};
private startRtc = (uid: number, channelId: string): void => {
this.setSliderExtending();
this.setState({isStartBtnLoading: true});
if (!this.agoraClient) {
this.agoraClient = AgoraRTC.createClient({mode: "live", codec: "h264"});
this.agoraClient.init(this.props.agoraAppId, () => {
console.log("AgoraRTC client initialized");
}, (err: any) => {
console.log("AgoraRTC client init failed", err);
});
}
const localStream = AgoraRTC.createStream({
streamID: uid,
audio: true,
video: true,
screen: false,
});
localStream.init(() => {
console.log("getUserMedia successfully");
this.setState({localStream: localStream});
localStream.play("rtc_local_stream");