Created
December 3, 2021 04:54
-
-
Save hieptl/45a0b08fa077770371a7bff26ea7d2a2 to your computer and use it in GitHub Desktop.
meeting.js - client - start direct call - Zoom Clone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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