openvidu-node-client: Connection.location and Connection.platform support

pull/121/head
pabloFuente 2018-09-05 17:03:03 +02:00
parent 5be51aa9e5
commit e0ba895faf
2 changed files with 14 additions and 2 deletions

View File

@ -38,6 +38,16 @@ export class Connection {
*/ */
token: string; token: string;
/**
* Geo location of the connection, with the following format: `"CITY, COUNTRY"` (`"unknown"` if it wasn't possible to locate it)
*/
location: string;
/**
* A complete description of the platform used by the participant to connect to the session
*/
platform: string;
/** /**
* Data associated to the connection on the server-side. This value is set with property [[TokenOptions.data]] when calling [[Session.generateToken]] * Data associated to the connection on the server-side. This value is set with property [[TokenOptions.data]] when calling [[Session.generateToken]]
*/ */
@ -64,11 +74,13 @@ export class Connection {
/** /**
* @hidden * @hidden
*/ */
constructor(connectionId: string, role: OpenViduRole, token: string, serverData: string, clientData: string, constructor(connectionId: string, role: OpenViduRole, token: string, location: string, platform: string, serverData: string, clientData: string,
publishers: Publisher[], subscribers: string[]) { publishers: Publisher[], subscribers: string[]) {
this.connectionId = connectionId; this.connectionId = connectionId;
this.role = role; this.role = role;
this.token = token; this.token = token;
this.location = location;
this.platform = platform;
this.serverData = serverData; this.serverData = serverData;
this.clientData = clientData; this.clientData = clientData;
this.publishers = publishers; this.publishers = publishers;

View File

@ -452,7 +452,7 @@ export class Session {
connection.subscribers.forEach(subscriber => { connection.subscribers.forEach(subscriber => {
subscribers.push(subscriber.streamId); subscribers.push(subscriber.streamId);
}); });
this.activeConnections.push(new Connection(connection.connectionId, connection.role, connection.token, connection.serverData, connection.clientData, publishers, subscribers)); this.activeConnections.push(new Connection(connection.connectionId, connection.role, connection.token, connection.location, connection.platform, connection.serverData, connection.clientData, publishers, subscribers));
}); });
return this; return this;
} }