We're offering up to 2 free months to any customer switching from Twilio video to Agora. Schedule some time to chat with our team to get the full details.
This guide will assist you in migrating your existing Twilio Video implementation to the Agora Video SDK. If you are initiating a new project, it is advised to refer to the Agora Video SDK documentation.
Quickstart demos for React
, Vue
, and Svelte
are provided. Check them out at Quickstart Demo. Additional demos can be found ar More Demos.
Please follow the documentation here: Video Calling SDK quickstart - Web.
Sign up for an account and log in to the Agora Console.
Navigate to the Project List tab under the Project Management tab, and create a project by clicking the blue Create button. (When prompted to use App ID + Certificate, select App ID only.) Retrieve the App ID, which will be used to authorize your requests while you’re developing the application.
Note: This guide does not implement token authentication, which is recommended for all RTE apps running in production environments. For more information about token-based authentication in the Agora platform, see this guide: https://docs.agora.io/en/video-calling/get-started/authentication-workflow?platform=web
To access Agora services and integrate them into your project, follow these steps to obtain the necessary information from the Agora Console:
By completing these steps, you’ll have the necessary credentials to integrate Agora services into your application. Refer to the Agora Console for detailed guidance on accessing and managing these credentials.
Use npm
, pnpm
, or yarn
If using npm:
npm uninstall twilio-video
If using Twilio CDN:
Remove the Twilio script tag from index.html
.
Proceed to the next step for configuration details.
createMicrophoneAndCameraTracks
:Create a local track using the audio and video captured by the microphone and camera at the same time, and return a list containing CameraVideoTrack and MicrophoneAudioTrack
Note on unpublish:
publish
and unpublish
to manage the publication and unpublishing of specific local tracks.Promise
or async/await
.Track destruction:
user-published
event. This event carries two parameters: the remote user object ( user
) and the media type published remotely ( mediaType
). At this point, you can use AgoraRTCClient.subscribe
to initiate subscription.After the subscription method completes, you can retrieve the corresponding RemoteAudioTrack
and RemoteVideoTrack
objects using user.audioTrack
and user.videoTrack
.
Subscription and publication differ, allowing you to subscribe to only one audio or video track at a time. Even if the publishing side simultaneously publishes both audio and video tracks, the SDK triggers the user-published
event twice: once for user-published(audio)
and once for user-published(video)
. Following the code logic above, it completes two subscriptions.
disconnect
function to leave a session.twilioVideo.disconnect()
leave
, the SDK immediately destroys objects related to the current channel, including subscribed remote user objects, remote track objects, and objects recording connection status. If you need to rejoin the channel, call join
after calling leave
.The Agora Video SDK provides a rich set of features that can enhance your video conferencing application. Here are some key features and information to consider:
For comprehensive details on Agora Video SDK features and how to implement them, refer to the Agora Video SDK Documentation.
Explore the full potential of Agora Video SDK to create a robust and feature-rich video conferencing experience. If you have specific feature requirements, consult the documentation for guidance on implementation.