Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ulixee
GitHub Repository: ulixee/secret-agent
Path: blob/main/plugins/default-browser-emulator/injected-scripts/RTCRtpSender.getCapabilities.ts
1029 views
1
// @ts-ignore
2
const { audioCodecs, videoCodecs } = args;
3
4
if ('RTCRtpSender' in self && RTCRtpSender.prototype) {
5
proxyFunction(RTCRtpSender, 'getCapabilities', function (target, thisArg, argArray) {
6
const kind = argArray && argArray.length ? argArray[0] : null;
7
const args = kind ? [kind] : undefined;
8
const capabilities = target.apply(thisArg, args);
9
if (kind === 'audio') capabilities.codecs = audioCodecs;
10
if (kind === 'video') capabilities.codecs = videoCodecs;
11
return capabilities;
12
});
13
}
14
15