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
|
||||
*/
|
||||
turnCredentials: RTCIceServer;
|
||||
iceServers: RTCIceServer[];
|
||||
/**
|
||||
* @hidden
|
||||
*/
|
||||
|
|
|
@ -945,9 +945,13 @@ export class Session implements EventDispatcher {
|
|||
this.openvidu.recorder = true;
|
||||
}
|
||||
if (!!turnUsername && !!turnCredential) {
|
||||
const stunUrl = 'stun:' + url.hostname + ':3478';
|
||||
const turnUrl1 = 'turn:' + url.hostname + ':3478';
|
||||
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 + ']')
|
||||
}
|
||||
if (!!role) {
|
||||
|
|
|
@ -530,8 +530,8 @@ export class Stream {
|
|||
returnValue = this.session.openvidu.advancedConfiguration.iceServers === 'freeice' ?
|
||||
undefined :
|
||||
this.session.openvidu.advancedConfiguration.iceServers;
|
||||
} else if (this.session.openvidu.turnCredentials) {
|
||||
returnValue = [this.session.openvidu.turnCredentials];
|
||||
} else if (this.session.openvidu.iceServers) {
|
||||
returnValue = this.session.openvidu.iceServers;
|
||||
} else {
|
||||
returnValue = undefined;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue