feat(stun-turn): add parameter to receive stun/turn servers (code format)

This commit is contained in:
Tiago Daniel Jacobs 2022-11-08 22:33:55 -03:00
parent 651d8cfa88
commit 913c68182a
5 changed files with 16 additions and 6 deletions

View File

@ -20,7 +20,9 @@ function createFullAudioOffer(instanceId: Number, stunTurnJson: String) {
resolve = res;
try {
console.log(`[${instanceId}] - >nativeCreateFullAudioOffer (${stunTurnJson})`);
console.log(
`[${instanceId}] - >nativeCreateFullAudioOffer (${stunTurnJson})`
);
// call native swift method that triggers the broadcast popup
nativeCreateFullAudioOffer(stunTurnJson);
} catch (e) {

View File

@ -20,7 +20,9 @@ function createScreenShareOffer(instanceId: Number, stunTurnJson: String) {
resolve = res;
try {
console.log(`[${instanceId}] - >nativeCreateScreenShareOffer (${stunTurnJson})`);
console.log(
`[${instanceId}] - >nativeCreateScreenShareOffer (${stunTurnJson})`
);
// call native swift method that triggers the broadcast popup
nativeCreateScreenShareOffer(stunTurnJson);
} catch (e) {

View File

@ -6,7 +6,7 @@ const FullAudioService = NativeModules.BBBN_FullAudioService;
// FullAudioService.initializeFullAudio();
// }
export function createFullAudioOffer(stunTurnJson:String) {
export function createFullAudioOffer(stunTurnJson: String) {
FullAudioService.createFullAudioOffer(stunTurnJson);
}

View File

@ -6,7 +6,7 @@ export function initializeScreenShare() {
ScreenShareService.initializeScreenShare();
}
export function createScreenShareOffer(stunTurnJson:String) {
export function createScreenShareOffer(stunTurnJson: String) {
ScreenShareService.createScreenShareOffer(stunTurnJson);
}

View File

@ -50,10 +50,16 @@ export function handleWebviewMessage(
promise = initializeScreenShare(instanceId);
break;
case 'createFullAudioOffer':
promise = createFullAudioOffer(instanceId, JSON.stringify(data?.arguments[0]));
promise = createFullAudioOffer(
instanceId,
JSON.stringify(data?.arguments[0])
);
break;
case 'createScreenShareOffer':
promise = createScreenShareOffer(instanceId, JSON.stringify(data?.arguments[0]));
promise = createScreenShareOffer(
instanceId,
JSON.stringify(data?.arguments[0])
);
break;
case 'setScreenShareRemoteSDP':
promise = setScreenShareRemoteSDP(instanceId, data?.arguments[0].sdp);