visit
Interactive interface development - Although the video call has only one page, there are various interactive buttons; each button has multiple states, that can be switched in different ways, rendering the interactive interface quite hard to handle.
Audio and video management - Audio and video management require a lot of testing and verification to ensure the stability of calls, such as different platforms, devices, system versions, and network environments which all need to be targeted. It's a time-consuming effort.
User permissions, call status, and other business-related - includes camera and microphone switch permissions, call permissions, call duration, hang up, waiting, and call status. These states seem simple, but since each of them has multiple modification paths, the logic underpinning a correct state is complex. For example, if the call is 'hung up, there can be 'active hang-up', 'passive hang-up', network 'error hang-up', 'insufficient quota', etc.
What is the Prebuilt SDK?
Create an account in .
Create a project in .
Call the init
interface to complete the SDK initialization.
Call the joinRoom
interface to join the audio and video call.
<html>
<style>
#root {
width: 100vw;
height: 100vh;
}
</style>
<body>
</body>
<script crossorigin src="//zegocloud.github.io/zegocloud_prebuilt_webrtc/ZegoPrebuilt/index.umd.js"></script>
<script>
const TOKEN = ''; // need to generate TOKEN first
const prebuilt = ZegoPrebuilt.init(TOKEN);
prebuilt.joinRoom({
container: document.querySelector("#root"),
});
</script>
</html>
prebuilt.joinRoom({
container: document.querySelector("#root"), // Mount the container, which fills the entire screen by default
joinScreen: {
visible: true; // Whether to display the device detection page, default display
title:"Join Room"; // Device detection page title, default Join Room
inviteURL:"//zegocloud.github.io/zegocloud_prebuilt_webrtc/build/index.html?RoomID=test"; // Invite link, not displayed by default
};
micEnabled: true; // Whether to enable your own microphone, it is enabled by default
cameraEnabled: true; // Whether to open your own camera, open by default
userCanToggleSelfCamera: true; // Whether you can control your own microphone, enabled by default
userCanToggleSelfMic: true; // Whether you can control the body's own camera, enabled by default
deviceSettings: true; // Whether to display audio settings, default display
chatEnabled: true; // Whether to enable chat, enabled by default
userListEnabled: true; //Whether to display the member list, the default display
notification: { // message notification in the lower left corner of the video
userOnlineOfflineTips: true; //Whether to display member in and out, default display
unreadMessageTips: true; // Whether to display unread messages, default display
};
leaveRoomCallback: () => void; // leave the room callback
branding: {
logoURL: "//www.zegocloud.com/_nuxt/img/zegocloud_logo_white.ddbab9f.png", // Brand logo in the upper left corner, not displayed by default
};
leftScreen: true; // leave the room page, default is
});