v1.4.3/members and version handling

This commit is contained in:
2020-07-19 03:27:05 -04:00
parent 21ac7e2f3f
commit c80121bf25
7 changed files with 64 additions and 39 deletions
+7 -5
View File
@@ -35,13 +35,15 @@ export default class CallManager {
this.__admin = false;
}
toggleCall(onCall, conference, admin) {
this.listener({ callActionPending: true });
this.__admin = admin;
if (onCall === true) this.leaveCall();
else this.boot(conference);
}
toggleMute(muted) {
this.listener({ callActionPending: true });
VoxeetSDK.conference.mute(VoxeetSDK.session.participant, !muted);
this.listener({ muted: !muted });
this.listener({ muted: !muted, callActionPending: false });
}
async boot(conference) {
await this.initialize();
@@ -93,7 +95,7 @@ export default class CallManager {
async leaveCall() {
VoxeetSDK.conference.leave().then(() => {
VoxeetSDK.session.close();
this.listener({ onCall: false });
this.listener({ onCall: false, callActionPending: false });
});
}
async openSession() {
@@ -114,11 +116,11 @@ export default class CallManager {
}
async initialize() {
VoxeetSDK.conference.on('joined', () => {
this.listener({ onCall: true });
this.listener({ onCall: true, callActionPending: false, voxeet: VoxeetSDK });
});
VoxeetSDK.conference.on('left', () => {
this.listener({ onCall: false });
this.listener({ onCall: false, callActionPending: false, voxeet: null });
});
VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
@@ -135,7 +137,7 @@ export default class CallManager {
});
VoxeetSDK.conference.on('streamRemoved', (participant, stream) => {
document.getElementById(participant.id).remove();
if (document.getElementById(participant.id)) document.getElementById(participant.id).remove();
});
if (