openvidu-node-client: TokenOptions.record

pull/550/head
pabloFuente 2020-10-05 13:59:22 +02:00
parent 0ae577ce6e
commit d493112f12
2 changed files with 16 additions and 6 deletions

View File

@ -102,11 +102,11 @@ export class Session {
const data = JSON.stringify({ const data = JSON.stringify({
session: this.sessionId, session: this.sessionId,
role: (!!tokenOptions && !!tokenOptions.role) ? tokenOptions.role : OpenViduRole.PUBLISHER, role: (!!tokenOptions && !!tokenOptions.role) ? tokenOptions.role : null,
data: (!!tokenOptions && !!tokenOptions.data) ? tokenOptions.data : '', data: (!!tokenOptions && !!tokenOptions.data) ? tokenOptions.data : null,
kurentoOptions: (!!tokenOptions && !!tokenOptions.kurentoOptions) ? tokenOptions.kurentoOptions : {}, record: !!tokenOptions ? tokenOptions.record : null,
kurentoOptions: (!!tokenOptions && !!tokenOptions.kurentoOptions) ? tokenOptions.kurentoOptions : null
}); });
axios.post( axios.post(
this.ov.host + OpenVidu.API_TOKENS, this.ov.host + OpenVidu.API_TOKENS,
data, data,

View File

@ -22,6 +22,13 @@ import { OpenViduRole } from './OpenViduRole';
*/ */
export interface TokenOptions { export interface TokenOptions {
/**
* The role assigned to this token
*
* @default PUBLISHER
*/
role?: OpenViduRole;
/** /**
* Secure (server-side) data associated to this token. Every client will receive this data in property `Connection.data`. Object `Connection` can be retrieved by subscribing to event `connectionCreated` of Session object. * Secure (server-side) data associated to this token. Every client will receive this data in property `Connection.data`. Object `Connection` can be retrieved by subscribing to event `connectionCreated` of Session object.
* - If you have provided no data in your clients when calling method `Session.connect(TOKEN, DATA)` (`DATA` not defined), then `Connection.data` will only have this [[TokenOptions.data]] property. * - If you have provided no data in your clients when calling method `Session.connect(TOKEN, DATA)` (`DATA` not defined), then `Connection.data` will only have this [[TokenOptions.data]] property.
@ -31,9 +38,12 @@ export interface TokenOptions {
data?: string; data?: string;
/** /**
* The role assigned to this token * Whether to record the streams published by the participant owning this token or not. This only affects [INDIVIDUAL recording](/en/stable/advanced-features/recording#selecting-streams-to-be-recorded)
*
* @default true
*/ */
role?: OpenViduRole; record?: boolean;
/** /**
* **WARNING**: experimental option. This interface may change in the near future * **WARNING**: experimental option. This interface may change in the near future