v1.6.2/cleanup

- remove api v2
- linting
This commit is contained in:
2020-08-14 10:57:38 -04:00
parent aaf2506f78
commit 56cd151a04
32 changed files with 476 additions and 1437 deletions
+21 -21
View File
@@ -9,14 +9,14 @@ ALL CONTENT ON WATCH PARTY'S WEBSITE OR IN WATCH PARTY'S CHROME EXTENSION APP, U
CITED ARE THE SOLE INTELECTUAL PROPERTY OF AYUSHYA AMITABH, AND MAY NOT BE
COPIED, EDITED, OR REPRODUCED WITHOUT PERMISSION.
************************************************************************/
import VoxeetSDK from "@voxeet/voxeet-web-sdk";
import VoxeetSDK from '@voxeet/voxeet-web-sdk';
import {
GetVoxeetTokenApi,
GetRefreshedVoxeetTokenApi,
LocalData,
UpdateVoxeetApi,
updateLocalData,
} from "./Api";
} from './Api';
export default class CallManager {
constructor(listener, notify) {
@@ -36,7 +36,7 @@ export default class CallManager {
if (onCall === true) this.leaveCall();
else this.boot(conference);
} catch (e) {
this.notify("Uh oh something went wrong, try rejoining the call.");
this.notify('Uh oh something went wrong, try rejoining the call.');
}
}
toggleMute(muted) {
@@ -52,14 +52,14 @@ export default class CallManager {
.fetch(conference._id)
.then(this.joinCall)
.catch((err) => {
console.error("Failed to fetch conference", err);
console.error('Failed to fetch conference', err);
this.startCall();
});
} else if (opened && !conference) {
this.startCall();
} else {
this.listener({ onCall: false, muted: false, callActionPending: false });
console.error("Unable to open Voxeet Session");
console.error('Unable to open Voxeet Session');
}
}
async startCall() {
@@ -89,7 +89,7 @@ export default class CallManager {
muted: false,
callActionPending: false,
});
console.error("Update Voxeet API Error", err);
console.error('Update Voxeet API Error', err);
return false;
}
});
@@ -101,11 +101,11 @@ export default class CallManager {
muted: false,
callActionPending: false,
});
console.error("Failed to update party Voxeet");
console.error('Failed to update party Voxeet');
}
});
} else {
this.notify("Ask your party admin to start the call.");
this.notify('Ask your party admin to start the call.');
this.leaveCall();
}
}
@@ -119,8 +119,8 @@ export default class CallManager {
muted: false,
callActionPending: false,
});
this.notify("Unable to join call. Try again in a moment.");
console.error("Error joining call", e);
this.notify('Unable to join call. Try again in a moment.');
console.error('Error joining call', e);
return true;
});
// Leave changes as comment for later
@@ -143,9 +143,9 @@ export default class CallManager {
});
return true;
} catch (error) {
console.error("Error Opening Voxeet Session", error);
console.error('Error Opening Voxeet Session', error);
}
console.error("Session not initialized");
console.error('Session not initialized');
return false;
}
return true;
@@ -158,14 +158,14 @@ export default class CallManager {
this.listener({ usersOnCall });
}
async initialize() {
VoxeetSDK.conference.on("participantAdded", () => this.usersListHandle());
VoxeetSDK.conference.on("participantUpdated", () => this.usersListHandle());
VoxeetSDK.conference.on('participantAdded', () => this.usersListHandle());
VoxeetSDK.conference.on('participantUpdated', () => this.usersListHandle());
VoxeetSDK.conference.on("joined", () => {
VoxeetSDK.conference.on('joined', () => {
this.listener({ onCall: true, callActionPending: false });
});
VoxeetSDK.conference.on("left", () => {
VoxeetSDK.conference.on('left', () => {
this.listener({
onCall: false,
callActionPending: false,
@@ -173,11 +173,11 @@ export default class CallManager {
});
});
VoxeetSDK.conference.on("streamAdded", (participant, stream) => {
VoxeetSDK.conference.on('streamAdded', (participant, stream) => {
this.listener({ callActionPending: false });
});
VoxeetSDK.conference.on("streamRemoved", (participant, stream) => {
VoxeetSDK.conference.on('streamRemoved', (participant, stream) => {
this.listener({ callActionPending: false });
});
@@ -195,11 +195,11 @@ export default class CallManager {
this.updateTokens(access_token, refresh_token);
VoxeetSDK.initializeToken(access_token, refresh_token);
} else {
console.error("Get Voxeet Token API Result Error", tokenResult);
console.error('Get Voxeet Token API Result Error', tokenResult);
}
})
.catch((err) => {
console.error("Get Voxeet Token API error", err);
console.error('Get Voxeet Token API error', err);
});
} else {
VoxeetSDK.initializeToken(this.__accessToken, this.__refreshToken);
@@ -215,7 +215,7 @@ export default class CallManager {
resolve(access_token);
})
.catch((err) => {
console.error("Get Voxeet Token API error", err);
console.error('Get Voxeet Token API error', err);
reject(err);
});
});