mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: Modified Session.ts to accept in processToken the new parameter coturnIp
parent
06225b4894
commit
bc7ee37a8d
|
@ -77,12 +77,12 @@ export class Session implements EventDispatcher {
|
||||||
*/
|
*/
|
||||||
remoteStreamsCreated: ObjMap<boolean> = {};
|
remoteStreamsCreated: ObjMap<boolean> = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
isFirstIonicIosSubscriber = true;
|
isFirstIonicIosSubscriber = true;
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
countDownForIonicIosSubscribersActive = true;
|
countDownForIonicIosSubscribersActive = true;
|
||||||
/**
|
/**
|
||||||
|
@ -1221,6 +1221,7 @@ export class Session implements EventDispatcher {
|
||||||
this.sessionId = <string>queryParams['sessionId'];
|
this.sessionId = <string>queryParams['sessionId'];
|
||||||
const secret = queryParams['secret'];
|
const secret = queryParams['secret'];
|
||||||
const recorder = queryParams['recorder'];
|
const recorder = queryParams['recorder'];
|
||||||
|
const coturnIp = queryParams['coturnIp'];
|
||||||
const turnUsername = queryParams['turnUsername'];
|
const turnUsername = queryParams['turnUsername'];
|
||||||
const turnCredential = queryParams['turnCredential'];
|
const turnCredential = queryParams['turnCredential'];
|
||||||
const role = queryParams['role'];
|
const role = queryParams['role'];
|
||||||
|
@ -1234,13 +1235,14 @@ export class Session implements EventDispatcher {
|
||||||
this.openvidu.recorder = true;
|
this.openvidu.recorder = true;
|
||||||
}
|
}
|
||||||
if (!!turnUsername && !!turnCredential) {
|
if (!!turnUsername && !!turnCredential) {
|
||||||
const stunUrl = 'stun:' + url.hostname + ':3478';
|
const stunUrl = 'stun:' + coturnIp + ':3478';
|
||||||
const turnUrl1 = 'turn:' + url.hostname + ':3478';
|
const turnUrl1 = 'turn:' + coturnIp + ':3478';
|
||||||
const turnUrl2 = turnUrl1 + '?transport=tcp';
|
const turnUrl2 = turnUrl1 + '?transport=tcp';
|
||||||
this.openvidu.iceServers = [
|
this.openvidu.iceServers = [
|
||||||
{ urls: [stunUrl] },
|
{ urls: [stunUrl] },
|
||||||
{ urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential }
|
{ urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential }
|
||||||
];
|
];
|
||||||
|
console.log("STUN/TURN server IP" + coturnIp);
|
||||||
console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']');
|
console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']');
|
||||||
}
|
}
|
||||||
if (!!role) {
|
if (!!role) {
|
||||||
|
|
Loading…
Reference in New Issue