mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: iceServers conf extended (stun, turn and turn with tcp transport)
parent
e4e7ba6c2d
commit
f006965fd2
|
@ -59,7 +59,7 @@ export class OpenVidu {
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
turnCredentials: RTCIceServer;
|
iceServers: RTCIceServer[];
|
||||||
/**
|
/**
|
||||||
* @hidden
|
* @hidden
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -945,9 +945,13 @@ 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 turnUrl1 = 'turn:' + url.hostname + ':3478';
|
const turnUrl1 = 'turn:' + url.hostname + ':3478';
|
||||||
const turnUrl2 = turnUrl1 + '?transport=tcp';
|
const turnUrl2 = turnUrl1 + '?transport=tcp';
|
||||||
this.openvidu.turnCredentials = { urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential };
|
this.openvidu.iceServers = [
|
||||||
|
{ urls: [stunUrl] },
|
||||||
|
{ urls: [turnUrl1, turnUrl2], username: turnUsername, credential: turnCredential }
|
||||||
|
];
|
||||||
console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']')
|
console.log('TURN temp credentials [' + turnUsername + ':' + turnCredential + ']')
|
||||||
}
|
}
|
||||||
if (!!role) {
|
if (!!role) {
|
||||||
|
|
|
@ -530,8 +530,8 @@ export class Stream {
|
||||||
returnValue = this.session.openvidu.advancedConfiguration.iceServers === 'freeice' ?
|
returnValue = this.session.openvidu.advancedConfiguration.iceServers === 'freeice' ?
|
||||||
undefined :
|
undefined :
|
||||||
this.session.openvidu.advancedConfiguration.iceServers;
|
this.session.openvidu.advancedConfiguration.iceServers;
|
||||||
} else if (this.session.openvidu.turnCredentials) {
|
} else if (this.session.openvidu.iceServers) {
|
||||||
returnValue = [this.session.openvidu.turnCredentials];
|
returnValue = this.session.openvidu.iceServers;
|
||||||
} else {
|
} else {
|
||||||
returnValue = undefined;
|
returnValue = undefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue