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; resolve = res;
try { try {
console.log(`[${instanceId}] - >nativeCreateFullAudioOffer (${stunTurnJson})`); console.log(
`[${instanceId}] - >nativeCreateFullAudioOffer (${stunTurnJson})`
);
// call native swift method that triggers the broadcast popup // call native swift method that triggers the broadcast popup
nativeCreateFullAudioOffer(stunTurnJson); nativeCreateFullAudioOffer(stunTurnJson);
} catch (e) { } catch (e) {

View File

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

View File

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

View File

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

View File

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