v1.6.0/conference call upgrade

- anyone can start call
- colision check for calls
- better error handing for calls
This commit is contained in:
2020-08-02 01:11:48 -04:00
parent c80a99cea1
commit 86ee168045
9 changed files with 184 additions and 51 deletions
+5 -3
View File
@@ -235,6 +235,7 @@ export default class Chat extends Component {
const data = {
partyName: LocalData().partyName,
};
if (this.state.onCall) this.mCallManager.toggleCall(this.state.onCall, this.state.conference, this.state.admin, this.state.adminOnly);
DeleteRoomApi(data)
.then((res) => {
this.props.notify('Ended party');
@@ -255,6 +256,7 @@ export default class Chat extends Component {
partyName: LocalData().partyName,
userUid: LocalData().userUid,
};
if (this.state.onCall) this.mCallManager.toggleCall(this.state.onCall, this.state.conference, this.state.admin, this.state.adminOnly);
LeaveRoomApi(data)
.then((res) => {
this.props.notify('Left party');
@@ -312,7 +314,7 @@ export default class Chat extends Component {
: giphyFetch.search(this.state.newMessage, { offset, limit: 1 });
}
handlePhoneCall() {
const { onCall, conference, admin } = this.state;
const { onCall, conference, admin, adminOnly } = this.state;
if (window.navigator && onCall === false) {
try {
const overlay = document.createElement('div');
@@ -328,7 +330,7 @@ export default class Chat extends Component {
})
.then(() => {
document.getElementById('mic-permission-overlay').remove();
this.mCallManager.toggleCall(onCall, conference, admin);
this.mCallManager.toggleCall(onCall, conference, admin, adminOnly);
})
.catch(() => {
document.getElementById('mic-permission-overlay').remove();
@@ -339,7 +341,7 @@ export default class Chat extends Component {
} catch (err) {
console.error('Handle Phone Call Error', err);
}
} else this.mCallManager.toggleCall(onCall, conference, admin);
} else this.mCallManager.toggleCall(onCall, conference, admin, adminOnly);
}
handleMute() {
this.mCallManager.toggleMute(this.state.muted);