mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Add call id to mute events (#827)
This commit is contained in:
parent
67d1c29d6a
commit
e5135a41ba
@ -121,13 +121,15 @@ export class LoginTracker {
|
|||||||
interface MuteMicrophone {
|
interface MuteMicrophone {
|
||||||
eventName: "MuteMicrophone";
|
eventName: "MuteMicrophone";
|
||||||
targetMuteState: "mute" | "unmute";
|
targetMuteState: "mute" | "unmute";
|
||||||
|
callId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MuteMicrophoneTracker {
|
export class MuteMicrophoneTracker {
|
||||||
track(targetIsMute: boolean) {
|
track(targetIsMute: boolean, callId: string) {
|
||||||
PosthogAnalytics.instance.trackEvent<MuteMicrophone>({
|
PosthogAnalytics.instance.trackEvent<MuteMicrophone>({
|
||||||
eventName: "MuteMicrophone",
|
eventName: "MuteMicrophone",
|
||||||
targetMuteState: targetIsMute ? "mute" : "unmute",
|
targetMuteState: targetIsMute ? "mute" : "unmute",
|
||||||
|
callId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,13 +137,15 @@ export class MuteMicrophoneTracker {
|
|||||||
interface MuteCamera {
|
interface MuteCamera {
|
||||||
eventName: "MuteCamera";
|
eventName: "MuteCamera";
|
||||||
targetMuteState: "mute" | "unmute";
|
targetMuteState: "mute" | "unmute";
|
||||||
|
callId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MuteCameraTracker {
|
export class MuteCameraTracker {
|
||||||
track(targetIsMute: boolean) {
|
track(targetIsMute: boolean, callId: string) {
|
||||||
PosthogAnalytics.instance.trackEvent<MuteCamera>({
|
PosthogAnalytics.instance.trackEvent<MuteCamera>({
|
||||||
eventName: "MuteCamera",
|
eventName: "MuteCamera",
|
||||||
targetMuteState: targetIsMute ? "mute" : "unmute",
|
targetMuteState: targetIsMute ? "mute" : "unmute",
|
||||||
|
callId,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -359,13 +359,19 @@ export function useGroupCall(groupCall: GroupCall): UseGroupCallReturnType {
|
|||||||
const toggleLocalVideoMuted = useCallback(() => {
|
const toggleLocalVideoMuted = useCallback(() => {
|
||||||
const toggleToMute = !groupCall.isLocalVideoMuted();
|
const toggleToMute = !groupCall.isLocalVideoMuted();
|
||||||
groupCall.setLocalVideoMuted(toggleToMute);
|
groupCall.setLocalVideoMuted(toggleToMute);
|
||||||
PosthogAnalytics.instance.eventMuteCamera.track(toggleToMute);
|
PosthogAnalytics.instance.eventMuteCamera.track(
|
||||||
|
toggleToMute,
|
||||||
|
groupCall.groupCallId
|
||||||
|
);
|
||||||
}, [groupCall]);
|
}, [groupCall]);
|
||||||
|
|
||||||
const setMicrophoneMuted = useCallback(
|
const setMicrophoneMuted = useCallback(
|
||||||
(setMuted) => {
|
(setMuted) => {
|
||||||
groupCall.setMicrophoneMuted(setMuted);
|
groupCall.setMicrophoneMuted(setMuted);
|
||||||
PosthogAnalytics.instance.eventMuteMicrophone.track(setMuted);
|
PosthogAnalytics.instance.eventMuteMicrophone.track(
|
||||||
|
setMuted,
|
||||||
|
groupCall.groupCallId
|
||||||
|
);
|
||||||
},
|
},
|
||||||
[groupCall]
|
[groupCall]
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user