How to use the agora-rtc-sdk.createClient function in agora-rtc-sdk

To help you get started, we’ve selected a few agora-rtc-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netless-io / netless-rtc-react-whiteboard / src / rtc / RtcDesktop.tsx View on Github external
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");
github netless-io / netless-rtc-react-whiteboard / src / components / whiteboard / ClassroomMedia.tsx View on Github external
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},
            };
github netless-io / netless-rtc-react-whiteboard / src / rtc / RtcDesktop.tsx View on Github external
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");

agora-rtc-sdk

AgoraRTC SDK for web

SEE LICENSE IN LICENSE.md
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis