Open YousefED opened 3 years ago
i wanted to turn this off and went down the rabbithole
let client = sdk.createClient({
baseUrl: server.baseUrl,
canSupportVoip: false, // <-- this here
});
https://matrix-org.github.io/matrix-js-sdk/20.1.0/client.ts.html#line1051
src/webrtc/call.ts:2721
export function supportsMatrixCall(): boolean {
// typeof prevents Node from erroring on an undefined reference
if (typeof(window) === 'undefined' || typeof(document) === 'undefined') {
// NB. We don't log here as apps try to create a call object as a test for
// whether calls are supported, so we shouldn't fill the logs up.
return false;
}
// Firefox throws on so little as accessing the RTCPeerConnection when operating in a secure mode.
// There's some information at https://bugzilla.mozilla.org/show_bug.cgi?id=1542616 though the concern
// is that the browser throwing a SecurityError will brick the client creation process.
try {
const supported = Boolean(
window.RTCPeerConnection || window.RTCSessionDescription ||
window.RTCIceCandidate || navigator.mediaDevices,
);
if (!supported) {
/* istanbul ignore if */ // Adds a lot of noise to test runs, so disable logging there.
if (process.env.NODE_ENV !== "test") {
logger.error("WebRTC is not supported in this browser / environment");
}
return false;
}
} catch (e) {
logger.error("Exception thrown when trying to access WebRTC", e);
return false;
}
return true;
}
It is not possible to disable this function, because the specified value is always overwritten by the call..
canSupportVoip: false, // <-- this here
This is not a valid createClient
option. canSupportVoip
is a private member field on the client instance.
+1 this would be great to be an option
+1
+1
on startClient, the client will always do a network call to fetch turn servers. I'm using matrix-js-sdk in an environment where I'm not interested in Voip, so as a consumer it would be great to disable this functionatlity completely.
I see that there's a
_supportsVoip
member on Client, but the client always does a check and enables it if supported