
- #Agora video call github how to
- #Agora video call github code
If Safari 12.1 or earlier is involved in the call, set codec as "h264".
codec specifies the codec that the web browser uses for encoding and decoding. The SDK applies different optimization methods according to the channel profile. Agora recommends using the "rtc" mode for one-to-one or group calls and the "live" mode for live broadcasts. Pay attention to the settings of the mode and codec parameters when creating the client: const rtc = ) Ĭall createClient to create a local client object. This is not mandatory and you can follow your own implementation preferences. #Agora video call github code
You can wrap all the following code snippets in the function. Visit dioTrack and Track to get the RemoteAudioTrack and RemoteVideoTrack objects of the remote user.įor convenience, we define two variables and a function for the following code snippets.Call AgoraRTCClient.subscribe to subscribe to the AgoraRTCRemoteUser object that you get in the previous step.Get an AgoraRTCRemoteUser object when the SDK triggers the AgoraRTCClient.on("user-published") event.Perform the following steps when a remote user joins the channel and publishes tracks: Call AgoraRTCClient.publish to publish the local audio and video tracks that you have created to the channel.Call createMicrophoneAudioTrack to create a MicrophoneAudioTrack object and call createCameraVideoTrack to create a CameraVideoTrack object.Call AgoraRTCClient.join to join a specified channel.
Call createClient to create an AgoraRTCClient object with your App ID. The process of implementing a basic video call is as follows: The Agora Web SDK NG controls the stream by operating the tracks. The LocalTrack and RemoteTrack interfaces provide methods for controlling audio and video, such as playback control.Ī media stream consists of an audio track and/or a video track. The LocalTrack and RemoteTrack objects, which represents the local and remote tracks. The AgoraRTCClient interface provides methods for implementing the major functions required for a video call, such as joining a channel and publishing local audio and video tracks. The AgoraRTCClient object, which represents a local user in the call. When using the Agora Web SDK NG, you need to work with the following two types of objects:
If you deploy your project over HTTP, you can only visit your project at ).
#Agora video call github how to
This article introduces how to use the Agora Web SDK NG to implement a basic video call.ĭue to security limits on HTTP addresses except 127.0.0.1, the Agora Web SDK NG only supports HTTPS or ( ).