Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created December 3, 2021 04:54
Show Gist options
  • Select an option

  • Save hieptl/45a0b08fa077770371a7bff26ea7d2a2 to your computer and use it in GitHub Desktop.

Select an option

Save hieptl/45a0b08fa077770371a7bff26ea7d2a2 to your computer and use it in GitHub Desktop.
meeting.js - client - start direct call - Zoom Clone
const startDirectCall = () => {
if (cometChat && meeting) {
const sessionID = meeting.meeting_uid;
const audioOnly = false;
const defaultLayout = true;
const callSettings = new cometChat.CallSettingsBuilder()
.enableDefaultLayout(defaultLayout)
.setSessionID(sessionID)
.setIsAudioOnlyCall(audioOnly)
.build();
cometChat.startCall(
callSettings,
document.getElementById("call__screen"),
new cometChat.OngoingCallListener({
onUserListUpdated: userList => {
},
onCallEnded: call => {
history.push('/');
},
onError: error => {
history.push('/');
},
onMediaDeviceListUpdated: deviceList => {
},
onUserMuted: (userMuted, userMutedBy) => {
},
onScreenShareStarted: () => {
},
onScreenShareStopped: () => {
}
})
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment