Patch Jitsi logs into rageshakes (#22270)

* Patch Jitsi logs into rageshakes

* Remove unused import

* Fix types
pull/22277/head
Robin 2022-05-19 04:24:39 -04:00 committed by GitHub
parent ff7398b21f
commit d36dcd2766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -357,6 +357,8 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
startAudioOnly, startAudioOnly,
startWithAudioMuted: audioDevice == null, startWithAudioMuted: audioDevice == null,
startWithVideoMuted: videoDevice == null, startWithVideoMuted: videoDevice == null,
// Request all log levels for inclusion in rageshakes
apiLogLevels: ["warn", "log", "error", "info", "debug"],
} as any, } as any,
jwt: jwt, jwt: jwt,
}; };
@ -411,7 +413,7 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
meetApi.on("audioMuteStatusChanged", ({ muted }) => { meetApi.on("audioMuteStatusChanged", ({ muted }) => {
const action = muted ? ElementWidgetActions.MuteAudio : ElementWidgetActions.UnmuteAudio; const action = muted ? ElementWidgetActions.MuteAudio : ElementWidgetActions.UnmuteAudio;
widgetApi.transport.send(action, {}); widgetApi?.transport.send(action, {});
}); });
meetApi.on("videoMuteStatusChanged", ({ muted }) => { meetApi.on("videoMuteStatusChanged", ({ muted }) => {
@ -421,10 +423,10 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
// otherwise the React SDK will mistakenly think the user turned off // otherwise the React SDK will mistakenly think the user turned off
// their video by hand // their video by hand
setTimeout(() => { setTimeout(() => {
if (meetApi) widgetApi.transport.send(ElementWidgetActions.MuteVideo, {}); if (meetApi) widgetApi?.transport.send(ElementWidgetActions.MuteVideo, {});
}, 200); }, 200);
} else { } else {
widgetApi.transport.send(ElementWidgetActions.UnmuteVideo, {}); widgetApi?.transport.send(ElementWidgetActions.UnmuteVideo, {});
} }
}); });
@ -435,4 +437,9 @@ function joinConference(audioDevice?: string, videoDevice?: string) {
}); });
}); });
}); });
// Patch logs into rageshakes
meetApi.on("log", ({ logLevel, args }) =>
(parent as unknown as typeof global).mx_rage_logger?.log(logLevel, ...args),
);
} }