Skip to content

Commit

Permalink
feat: firefox conference calling (#16015)
Browse files Browse the repository at this point in the history
  • Loading branch information
z-dule authored Oct 23, 2023
1 parent 9a3b41a commit 7c8f2a3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@lexical/history": "0.12.2",
"@lexical/react": "0.12.2",
"@peculiar/x509": "1.9.5",
"@wireapp/avs": "9.4.18",
"@wireapp/avs": "9.5.2",
"@wireapp/commons": "5.2.1",
"@wireapp/core": "42.16.0",
"@wireapp/lru-cache": "3.8.1",
Expand Down
4 changes: 3 additions & 1 deletion src/script/calling/CallingRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export class CallingRepository {
private wCall?: Wcall;
private wUser: number = 0;
private nextMuteState: MuteState = MuteState.SELF_MUTED;
private isConferenceCallingSupported = false;
/**
* Keeps track of the size of the avs log once the webapp is initiated. This allows detecting meaningless avs logs (logs that have a length equal to the length when the webapp was initiated)
*/
Expand Down Expand Up @@ -255,6 +256,7 @@ export class CallingRepository {
wCall.setUserMediaHandler(this.getCallMediaStream);
wCall.setAudioStreamHandler(this.updateCallAudioStreams);
wCall.setVideoStreamHandler(this.updateParticipantVideoStream);
this.isConferenceCallingSupported = wCall.isConferenceCallingSupported();
setInterval(() => wCall.poll(), 500);
return wCall;
}
Expand Down Expand Up @@ -499,7 +501,7 @@ export class CallingRepository {
* @see https://www.chromestatus.com/feature/6321945865879552
*/
get supportsConferenceCalling(): boolean {
return Runtime.isSupportingConferenceCalling();
return this.isConferenceCallingSupported;
}

/**
Expand Down
11 changes: 10 additions & 1 deletion src/script/util/test/mock/WebRTCMock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@

import wrtc from '@koush/wrtc';

const {RTCAudioSource} = wrtc.nonstandard;
const {RTCAudioSource, RTCRtpSender} = wrtc.nonstandard;

declare global {
interface Window {
MediaStream: typeof wrtc.MediaStream;
RTCAudioSource: typeof RTCAudioSource;
RTCRtpSender: typeof RTCRtpSender;
}
}
const RTCRtpSenderMock: Window['RTCRtpSender'] = {
prototype: {createEncodedVideoStreams: {}, createEncodedStreams: {}, transform: {}},
};

Object.defineProperty(window, 'MediaStream', {
value: wrtc.MediaStream,
Expand All @@ -37,3 +41,8 @@ Object.defineProperty(window, 'RTCAudioSource', {
value: RTCAudioSource,
writable: true,
});

Object.defineProperty(window, 'RTCRtpSender', {
value: RTCRtpSenderMock,
writable: true,
});
1 change: 1 addition & 0 deletions src/types/NodeModules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
declare module '@koush/wrtc' {
export const nonstandard: {
RTCAudioSource: any;
RTCRtpSender: {prototype: {createEncodedVideoStreams: any; createEncodedStreams: any; transform: any}};
};
export const MediaStream: any;
}
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5316,10 +5316,10 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/avs@npm:9.4.18":
version: 9.4.18
resolution: "@wireapp/avs@npm:9.4.18"
checksum: 6786018a880336bba8b1e00cc35de0b5834efedd3ecd8cc5c905fb40ef9cb3b8adc63d23bd202e3ba58e104fd4b9b011900d76f951e84e62de0bea0b5a8f32be
"@wireapp/avs@npm:9.5.2":
version: 9.5.2
resolution: "@wireapp/avs@npm:9.5.2"
checksum: e728dfed25af97c6dee587a7f9174466971866993e098a0017eba37ed40a70b4a4155f4f9ab25968020e048ee1a31ced8ae9a224ee77cb793a556b40a01950af
languageName: node
linkType: hard

Expand Down Expand Up @@ -18520,7 +18520,7 @@ __metadata:
"@types/speakingurl": 13.0.4
"@types/underscore": 1.11.12
"@types/webpack-env": 1.18.3
"@wireapp/avs": 9.4.18
"@wireapp/avs": 9.5.2
"@wireapp/commons": 5.2.1
"@wireapp/copy-config": 2.1.9
"@wireapp/core": 42.16.0
Expand Down

0 comments on commit 7c8f2a3

Please sign in to comment.