From 5ce7676253563eddb4e1be5401bfddb9d3a5a18f Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Thu, 22 Oct 2020 14:25:13 +0000 Subject: [PATCH 1/8] Bump winston (2.4.5) and ws (7.3.1) --- package-lock.json | 29 ++++++----------------------- package.json | 4 ++-- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 29dc22ec..b2b0a2ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -486,11 +486,6 @@ "resolved": "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz", "integrity": "sha1-MgtaUtg6u1l42Bo+iH1K77FaYWQ=" }, - "ultron": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==" - }, "util.promisify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", @@ -529,9 +524,9 @@ } }, "winston": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.2.tgz", - "integrity": "sha512-4S/Ad4ZfSNl8OccCLxnJmNISWcm2joa6Q0YGDxlxMzH0fgSwWsjMt+SmlNwCqdpaPg3ev1HKkMBsIiXeSUwpbA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.5.tgz", + "integrity": "sha512-TWoamHt5yYvsMarGlGEQE59SbJHqGsZV8/lwC+iCcGeAe0vUaOh+Lv6SYM17ouzC/a/LB1/hz/7sxFBtlu1l4A==", "requires": { "async": "~1.0.0", "colors": "1.0.x", @@ -549,21 +544,9 @@ } }, "ws": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", - "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0", - "ultron": "~1.1.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } - } + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==" }, "xml2js": { "version": "0.4.22", diff --git a/package.json b/package.json index ec6855cd..2776b96b 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "redis": "2.8.0", "sdp-transform": "2.13.0", "sip.js": "git+https://github.com/mconf/sip.js.git#v0.7.5.10", - "winston": "2.4.2", - "ws": "3.3.3" + "winston": "2.4.5", + "ws": "7.3.1" }, "optionalDependencies": {} } From 8366d8391946acecdf1d7da92643009956a35c29 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Thu, 22 Oct 2020 14:25:48 +0000 Subject: [PATCH 2/8] Bump Docker node.js version to 14 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8da61396..fd58ae47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:12 +FROM node:14 ADD . app From 5f35bea041064ec3b8c9563b4fdcce5eabf02cb3 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Fri, 23 Oct 2020 12:53:07 +0000 Subject: [PATCH 3/8] 2.4.21 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b2b0a2ce..6df0fc01 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bbb-webrtc-sfu", - "version": "2.4.20", + "version": "2.4.21", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2776b96b..9fb2e153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbb-webrtc-sfu", - "version": "2.4.20", + "version": "2.4.21", "private": true, "scripts": { "start": "node server.js", From 6521402d490f877885b9c57f96bae8f4911bd669 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Sun, 25 Oct 2020 20:40:06 +0000 Subject: [PATCH 4/8] [screenshare] Add playStart response on media flowing event --- lib/screenshare/screenshare.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/screenshare/screenshare.js b/lib/screenshare/screenshare.js index e77fb7ca..009fda64 100644 --- a/lib/screenshare/screenshare.js +++ b/lib/screenshare/screenshare.js @@ -158,7 +158,6 @@ module.exports = class Screenshare extends BaseProvider { connectionId, type: C.SCREENSHARE_APP, id : 'iceCandidate', - cameraId: this._connectionId, candidate : candidate }), C.FROM_SCREENSHARE); } @@ -176,6 +175,7 @@ module.exports = class Screenshare extends BaseProvider { this.startRecording(); } this._status = C.MEDIA_STARTED; + this.sendPlayStart(C.SEND_ROLE, connectionId); } } }; @@ -186,9 +186,24 @@ module.exports = class Screenshare extends BaseProvider { // TODO properly implement a handler when we have a client-side reconnection procedure } + sendPlayStart (role, connectionId) { + this.bbbGW.publish(JSON.stringify({ + type: C.SCREENSHARE_APP, + id : 'playStart', + connectionId, + role, + }), C.FROM_SCREENSHARE); + } + _onViewerWebRTCMediaFlowing (connectionId) { Logger.info(LOG_PREFIX, `Viewer WebRTC session is FLOWING`, this._getFullViewerLogMetadata(connectionId)); + const viewerUser = this._viewerUsers[connectionId]; + + if (viewerUser && !viewerUser.started) { + this.sendPlayStart(C.RECV_ROLE, connectionId); + viewerUser.started = true; + } } _onViewerWebRTCMediaNotFlowing (connectionId) { @@ -614,7 +629,11 @@ module.exports = class Screenshare extends BaseProvider { this._voiceBridge, 'SFU', { externalUserId: userId, name: bbbUserName, autoLeave: true }); - this._viewerUsers[connectionId] = { userId, connectionId }; + this._viewerUsers[connectionId] = { + userId, + connectionId, + started: false, + }; // Get the REMB spec to be used. Screenshare uses the default mixed in with // the default spec bitrate. Fetching bitrate by the VP8 codec is just an From 10bd1545f2a30a91d9b81549a56c5202acc37fe2 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Sun, 25 Oct 2020 20:42:43 +0000 Subject: [PATCH 5/8] [screenshare] Fix startViewer error handling --- lib/screenshare/screenshare.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/screenshare/screenshare.js b/lib/screenshare/screenshare.js index 009fda64..b0a6211a 100644 --- a/lib/screenshare/screenshare.js +++ b/lib/screenshare/screenshare.js @@ -676,11 +676,10 @@ module.exports = class Screenshare extends BaseProvider { this._getFullViewerLogMetadata(connectionId)); return resolve(sdpAnswer); - } - catch (err) { - Logger.error(LOG_PREFIX, `Viewer subscribe failed for ${userId} due to ${err.message}`, - { ...this._getFullViewerLogMetadata(id), error: this._handleError(LOG_PREFIX, err) }); - return reject(this._handleError(LOG_PREFIX, err)); + } catch (error) { + Logger.error(LOG_PREFIX, `Viewer subscribe failed for ${userId} due to ${error.message}`, + { ...this._getFullViewerLogMetadata(connectionId), error: this._handleError(LOG_PREFIX, error) }); + return reject(this._handleError(LOG_PREFIX, error)); } }); } From 24646654c842ebd41e1d1fef274eb3f9c158277e Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Mon, 26 Oct 2020 19:16:43 +0000 Subject: [PATCH 6/8] [video] Experiment: add back server-client playStop request on media timeout --- lib/video/video.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/video/video.js b/lib/video/video.js index 0f5988fe..9f39a84f 100644 --- a/lib/video/video.js +++ b/lib/video/video.js @@ -302,6 +302,14 @@ module.exports = class Video extends BaseProvider { this.id ); + this.bbbGW.publish(JSON.stringify({ + connectionId: this.connectionId, + type: 'video', + role: this.role, + id : 'playStop', + cameraId: this.id, + }), C.FROM_VIDEO); + this.bbbGW.publish(userCamEvent, C.TO_AKKA_APPS_CHAN_2x); } From 5c2fbb5cc75db38167fd1aac0ee79e1474ed3f00 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Tue, 27 Oct 2020 00:13:48 +0000 Subject: [PATCH 7/8] [screenshare] Add configuration flag for playStart response, disabled by default (experimental) --- config/custom-environment-variables.yml | 3 +++ config/default.example.yml | 1 + lib/screenshare/screenshare.js | 17 +++++++++++------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/config/custom-environment-variables.yml b/config/custom-environment-variables.yml index 38d4e767..b0367939 100644 --- a/config/custom-environment-variables.yml +++ b/config/custom-environment-variables.yml @@ -75,6 +75,9 @@ videoSubscriberSpecSlave: screenshareSubscriberSpecSlave: __name: SCREENSHARE_SUBSCRIBER_SLAVE __format: json +screensharePlayStartEnabled: + __name: SCREENSHARE_PLAY_START_ENABLED + __format: json kurentoAllowedCandidateIps: __name: KURENTO_ALLOWED_CANDIDATE_IPS diff --git a/config/default.example.yml b/config/default.example.yml index 3d224d4b..4815c213 100644 --- a/config/default.example.yml +++ b/config/default.example.yml @@ -45,6 +45,7 @@ common-message-version: 2.x screenshareKeyframeInterval: 0 screenshareEnableFlashRTPBridge: false screenshareSubscriberSpecSlave: false +screensharePlayStartEnabled: false videoSubscriberSpecSlave: false recordScreenSharing: true diff --git a/lib/screenshare/screenshare.js b/lib/screenshare/screenshare.js index b0a6211a..74b5843c 100644 --- a/lib/screenshare/screenshare.js +++ b/lib/screenshare/screenshare.js @@ -27,6 +27,9 @@ const SUBSCRIBER_SPEC_SLAVE = config.has('videoSubscriberSpecSlave') ? config.get('videoSubscriberSpecSlave') : false; const KURENTO_REMB_PARAMS = config.util.cloneDeep(config.get('kurentoRembParams')); +const SCREENSHARE_PLAY_START_ENABLED = config.has(`screensharePlayStartEnabled`) + ? config.get(`screensharePlayStartEnabled`) + : false; const LOG_PREFIX = "[screenshare]"; @@ -187,12 +190,14 @@ module.exports = class Screenshare extends BaseProvider { } sendPlayStart (role, connectionId) { - this.bbbGW.publish(JSON.stringify({ - type: C.SCREENSHARE_APP, - id : 'playStart', - connectionId, - role, - }), C.FROM_SCREENSHARE); + if (SCREENSHARE_PLAY_START_ENABLED) { + this.bbbGW.publish(JSON.stringify({ + type: C.SCREENSHARE_APP, + id : 'playStart', + connectionId, + role, + }), C.FROM_SCREENSHARE); + } } _onViewerWebRTCMediaFlowing (connectionId) { From a980d40db68d02717ce028809240af7f2e57b667 Mon Sep 17 00:00:00 2001 From: prlanzarin Date: Tue, 27 Oct 2020 00:15:34 +0000 Subject: [PATCH 8/8] 2.4.22 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6df0fc01..e78a8b62 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bbb-webrtc-sfu", - "version": "2.4.21", + "version": "2.4.22", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9fb2e153..f86645dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbb-webrtc-sfu", - "version": "2.4.21", + "version": "2.4.22", "private": true, "scripts": { "start": "node server.js",