Fix private method signatures

This commit is contained in:
Robert Long
2021-09-10 16:06:26 -07:00
parent eb2a47623f
commit fb3ca90bc9
3 changed files with 27 additions and 23 deletions
+5 -1
View File
@@ -35,7 +35,7 @@ export class CallFeed extends EventEmitter {
private analyser: AnalyserNode;
private frequencyBinCount: Float32Array;
private speakingThreshold = SPEAKING_THRESHOLD;
public speaking = false;
private speaking = false;
private volumeLooperTimeout: number;
constructor(
@@ -110,6 +110,10 @@ export class CallFeed extends EventEmitter {
return this.stream.getVideoTracks().length === 0 || this.videoMuted;
}
public isSpeaking(): boolean {
return this.speaking;
}
/**
* Replaces the current MediaStream with a new one.
* This method should be only used by MatrixCall.
+14 -14
View File
@@ -51,7 +51,7 @@ export class GroupCall extends EventEmitter {
this.reEmitter = new ReEmitter(this);
}
async initLocalParticipant() {
public async initLocalParticipant() {
if (this.localParticipant) {
return this.localParticipant;
}
@@ -89,7 +89,7 @@ export class GroupCall extends EventEmitter {
return this.localParticipant;
}
async enter() {
public async enter() {
if (!this.localParticipant) {
await this.initLocalParticipant();
}
@@ -135,7 +135,7 @@ export class GroupCall extends EventEmitter {
this.onActiveSpeakerLoop();
}
leave() {
public leave() {
this.localParticipant = null;
this.client.stopLocalMediaStream();
@@ -181,7 +181,7 @@ export class GroupCall extends EventEmitter {
this.emit(GroupCallEvent.Left);
}
isLocalVideoMuted() {
public isLocalVideoMuted() {
if (this.localParticipant) {
return this.localParticipant.isVideoMuted();
}
@@ -189,7 +189,7 @@ export class GroupCall extends EventEmitter {
return true;
}
isMicrophoneMuted() {
public isMicrophoneMuted() {
if (this.localParticipant) {
return this.localParticipant.isAudioMuted();
}
@@ -197,7 +197,7 @@ export class GroupCall extends EventEmitter {
return true;
}
setMicrophoneMuted(muted) {
public setMicrophoneMuted(muted) {
if (this.localParticipant) {
const usermediaFeed = this.localParticipant.usermediaFeed;
@@ -227,7 +227,7 @@ export class GroupCall extends EventEmitter {
this.emit(GroupCallEvent.LocalMuteStateChanged, muted, this.isLocalVideoMuted());
}
setLocalVideoMuted(muted) {
public setLocalVideoMuted(muted) {
if (this.localParticipant) {
const usermediaFeed = this.localParticipant.usermediaFeed;
@@ -269,7 +269,7 @@ export class GroupCall extends EventEmitter {
* Call presence
*/
onPresenceLoop = () => {
private onPresenceLoop = () => {
const userId = this.client.getUserId();
const currentMemberState = this.room.currentState.getStateEvents(
"m.room.member",
@@ -333,7 +333,7 @@ export class GroupCall extends EventEmitter {
* as they are observed by the RoomState.members event.
*/
processInitialCalls() {
private processInitialCalls() {
const calls = this.client.callEventHandler.calls.values();
for (const call of calls) {
@@ -341,7 +341,7 @@ export class GroupCall extends EventEmitter {
}
}
onIncomingCall = (call: MatrixCall) => {
private onIncomingCall = (call: MatrixCall) => {
// The incoming calls may be for another room, which we will ignore.
if (call.roomId !== this.room.roomId) {
return;
@@ -396,7 +396,7 @@ export class GroupCall extends EventEmitter {
}
};
onRoomStateMembers = (_event, _state, member: RoomMember) => {
private onRoomStateMembers = (_event, _state, member: RoomMember) => {
// The member events may be received for another room, which we will ignore.
if (member.roomId !== this.room.roomId) {
return;
@@ -406,7 +406,7 @@ export class GroupCall extends EventEmitter {
this.onMemberChanged(member);
};
onMemberChanged = (member: RoomMember) => {
private onMemberChanged = (member: RoomMember) => {
// Don't process your own member.
const localUserId = this.client.getUserId();
@@ -496,7 +496,7 @@ export class GroupCall extends EventEmitter {
}
};
onActiveSpeakerLoop = () => {
private onActiveSpeakerLoop = () => {
let topAvg;
let nextActiveSpeaker;
@@ -532,7 +532,7 @@ export class GroupCall extends EventEmitter {
*/
// TODO: move this elsewhere or get rid of the retry logic. Do we need it?
sendStateEventWithRetry(
private sendStateEventWithRetry(
roomId: string,
eventType: string,
content: any,
+8 -8
View File
@@ -145,7 +145,7 @@ export class GroupCallParticipant extends EventEmitter {
}
};
onCallFeedsChanged = () => {
private onCallFeedsChanged = () => {
const nextUsermediaFeed = this.usermediaFeed;
if (nextUsermediaFeed && nextUsermediaFeed !== this.initializedUsermediaFeed) {
@@ -167,7 +167,7 @@ export class GroupCallParticipant extends EventEmitter {
this.emit(GroupCallParticipantEvent.CallFeedsChanged);
};
initUserMediaFeed(callFeed: CallFeed) {
private initUserMediaFeed(callFeed: CallFeed) {
this.initializedUsermediaFeed = callFeed;
callFeed.setSpeakingThreshold(this.groupCall.speakingThreshold);
callFeed.measureVolumeActivity(true);
@@ -186,12 +186,12 @@ export class GroupCallParticipant extends EventEmitter {
);
}
onCallReplaced = (newCall) => {
private onCallReplaced = (newCall) => {
// TODO: Should we always reuse the sessionId?
this.replaceCall(newCall, this.sessionId);
};
onCallHangup = () => {
private onCallHangup = () => {
if (this.call.hangupReason === CallErrorCode.Replaced) {
return;
}
@@ -215,17 +215,17 @@ export class GroupCallParticipant extends EventEmitter {
this.groupCall.emit(GroupCallEvent.ParticipantsChanged, this.groupCall.participants);
};
onCallFeedSpeaking = (speaking: boolean) => {
private onCallFeedSpeaking = (speaking: boolean) => {
this.emit(GroupCallParticipantEvent.Speaking, speaking);
};
onCallFeedVolumeChanged = (maxVolume: number) => {
private onCallFeedVolumeChanged = (maxVolume: number) => {
this.activeSpeakerSamples.shift();
this.activeSpeakerSamples.push(maxVolume);
this.emit(GroupCallParticipantEvent.VolumeChanged, maxVolume);
};
onCallFeedMuteStateChanged = (audioMuted: boolean, videoMuted: boolean) => {
private onCallFeedMuteStateChanged = (audioMuted: boolean, videoMuted: boolean) => {
if (audioMuted) {
this.activeSpeakerSamples = Array(this.groupCall.activeSpeakerSampleCount).fill(
-Infinity,
@@ -235,7 +235,7 @@ export class GroupCallParticipant extends EventEmitter {
this.emit(GroupCallParticipantEvent.MuteStateChanged, audioMuted, videoMuted);
};
onCallDataChannel = (dataChannel: RTCDataChannel) => {
private onCallDataChannel = (dataChannel: RTCDataChannel) => {
this.dataChannel = dataChannel;
this.emit(GroupCallParticipantEvent.Datachannel, dataChannel);
};