From 0f781f44fda80d22a2263f0620c3ecf80dc17ac2 Mon Sep 17 00:00:00 2001 From: pabloFuente Date: Mon, 25 Jan 2021 10:51:19 +0100 Subject: [PATCH] openvidu-node-client: send ConnectionProperties values on Session#createConnection --- openvidu-node-client/src/Session.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/openvidu-node-client/src/Session.ts b/openvidu-node-client/src/Session.ts index 6393179c..963efe41 100644 --- a/openvidu-node-client/src/Session.ts +++ b/openvidu-node-client/src/Session.ts @@ -145,10 +145,15 @@ export class Session { public createConnection(connectionProperties?: ConnectionProperties): Promise { return new Promise((resolve, reject) => { const data = JSON.stringify({ - role: (!!connectionProperties && !!connectionProperties.role) ? connectionProperties.role : null, + type: (!!connectionProperties && !!connectionProperties.type) ? connectionProperties.type : null, data: (!!connectionProperties && !!connectionProperties.data) ? connectionProperties.data : null, record: !!connectionProperties ? connectionProperties.record : null, - kurentoOptions: (!!connectionProperties && !!connectionProperties.kurentoOptions) ? connectionProperties.kurentoOptions : null + role: (!!connectionProperties && !!connectionProperties.role) ? connectionProperties.role : null, + kurentoOptions: (!!connectionProperties && !!connectionProperties.kurentoOptions) ? connectionProperties.kurentoOptions : null, + rtspUri: (!!connectionProperties && !!connectionProperties.rtspUri) ? connectionProperties.rtspUri : null, + adaptativeBitrate: !!connectionProperties ? connectionProperties.adaptativeBitrate : null, + onlyPlayWithSubscribers: !!connectionProperties ? connectionProperties.onlyPlayWithSubscribers : null, + networkCache: (!!connectionProperties && (connectionProperties.networkCache != null)) ? connectionProperties.networkCache : null }); axios.post( this.ov.host + OpenVidu.API_SESSIONS + '/' + this.sessionId + '/connection', @@ -471,8 +476,10 @@ export class Session { const forcedVideoCodec = !!this.properties.forcedVideoCodec ? this.properties.forcedVideoCodec : undefined; const allowTranscoding = this.properties.allowTranscoding != null ? this.properties.allowTranscoding : undefined; - const data = JSON.stringify({mediaMode, recordingMode, defaultOutputMode, defaultRecordingLayout, defaultCustomLayout, - customSessionId, mediaNode, forcedVideoCodec, allowTranscoding}); + const data = JSON.stringify({ + mediaMode, recordingMode, defaultOutputMode, defaultRecordingLayout, defaultCustomLayout, + customSessionId, mediaNode, forcedVideoCodec, allowTranscoding + }); axios.post( this.ov.host + OpenVidu.API_SESSIONS,