openvidu-browser: retrieve webrtcStatsInterval value from token

pull/255/head
pabloFuente 2019-03-05 17:33:30 +01:00
parent 182422f09f
commit e3a2574852
3 changed files with 19 additions and 10 deletions

View File

@ -68,19 +68,11 @@ export class Connection {
* @hidden
*/
constructor(private session: Session, opts?: ConnectionOptions) {
let msg = "'Connection' created ";
if (!!opts) {
msg += "(remote) with 'connectionId' [" + opts.id + ']';
} else {
msg += '(local)';
}
console.info(msg);
this.options = opts;
if (!!opts) {
// Connection is remote
msg += "(remote) with 'connectionId' [" + opts.id + ']';
this.options = opts;
this.connectionId = opts.id;
this.creationTime = opts.createdAt;
if (opts.metadata) {
@ -89,7 +81,11 @@ export class Connection {
if (opts.streams) {
this.initRemoteStreams(opts.streams);
}
} else {
// Connection is local
msg += '(local)';
}
console.info(msg);
}

View File

@ -53,6 +53,10 @@ export class OpenVidu {
* @hidden
*/
wsUri: string;
/**
* @hidden
*/
httpUri: string;
/**
* @hidden
*/
@ -73,6 +77,10 @@ export class OpenVidu {
* @hidden
*/
advancedConfiguration: OpenViduAdvancedConfiguration = {};
/**
* @hidden
*/
webrtcStatsInterval: number = 0;
constructor() {
console.info("'OpenVidu' initialized");

View File

@ -1144,6 +1144,7 @@ export class Session implements EventDispatcher {
const turnUsername = url.searchParams.get('turnUsername');
const turnCredential = url.searchParams.get('turnCredential');
const role = url.searchParams.get('role');
const webrtcStatsInterval = url.searchParams.get('webrtcStatsInterval');
if (!!secret) {
this.openvidu.secret = secret;
@ -1164,8 +1165,12 @@ export class Session implements EventDispatcher {
if (!!role) {
this.openvidu.role = role;
}
if (!!webrtcStatsInterval) {
this.openvidu.webrtcStatsInterval = +webrtcStatsInterval;
}
this.openvidu.wsUri = 'wss://' + url.host + '/openvidu';
this.openvidu.httpUri = 'https://' + url.host;
}
}