fcr-core 3.8.0-alpha → 3.8.1-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chat-connection/index.js +26 -40
- package/lib/engine/index.js +72 -66
- package/lib/imports.js +0 -1
- package/lib/media-control/desktop.js +13 -18
- package/lib/media-control/mobile.js +13 -18
- package/lib/monitor-control/index.js +5 -10
- package/lib/peer-session/index.js +39 -47
- package/lib/plugins/chatroom.js +213 -229
- package/lib/room-control/ability-control/index.js +9 -14
- package/lib/room-control/group-control/index.js +16 -21
- package/lib/room-control/helpers/validation-helper.js +1 -1
- package/lib/room-control/index.js +36 -53
- package/lib/room-control/interpreter-control/index.js +34 -47
- package/lib/room-control/interpreter-control/room.js +4 -6
- package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
- package/lib/room-control/mainroom-control/index.js +27 -35
- package/lib/room-control/privilege-control/helper.js +5 -8
- package/lib/room-control/privilege-control/index.js +19 -26
- package/lib/room-control/room-connector-control/index.js +19 -28
- package/lib/room-control/room-control-factory.js +1 -2
- package/lib/room-control/room-session/index.js +39 -46
- package/lib/room-control/shared-cache.js +29 -36
- package/lib/room-control/sharing-control/index.d.ts +1 -1
- package/lib/room-control/sharing-control/index.js +34 -42
- package/lib/room-control/stream-control/index.js +191 -195
- package/lib/room-control/stream-control/type.d.ts +1 -1
- package/lib/room-control/stt-control/de-compress-gzip.js +0 -10
- package/lib/room-control/stt-control/index.js +95 -98
- package/lib/room-control/stt-control/type.d.ts +1 -1
- package/lib/room-control/user-control/index.js +136 -143
- package/lib/room-control/waitingroom-control/index.js +9 -14
- package/lib/room-control/whiteboard-control/utils.js +2 -4
- package/lib/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
- package/lib/room-control/whiteboard-control-v1/board-window.js +88 -99
- package/lib/room-control/whiteboard-control-v1/factory.js +4 -7
- package/lib/room-control/whiteboard-control-v1/index.js +28 -40
- package/lib/room-control/whiteboard-control-v1/mount-manager.js +2 -4
- package/lib/room-control/whiteboard-control-v1/utils.js +14 -17
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +4 -6
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +5 -10
- package/lib/room-control/whiteboard-control-v2/base/index.js +34 -41
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +24 -29
- package/lib/room-control/whiteboard-control-v2/utils.js +6 -7
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +0 -1
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +23 -34
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +7 -14
- package/lib/room-router/index.js +47 -53
- package/lib/room-router/type.d.ts +2 -2
- package/lib/service/api.js +227 -250
- package/lib/utilities/collection.js +2 -3
- package/lib/utilities/error-helpers.js +27 -34
- package/lib/utilities/error.js +8 -9
- package/lib/utilities/join-helper.js +25 -32
- package/lib/utilities/logger.js +3 -6
- package/lib/utilities/parameters.js +4 -8
- package/lib/utilities/retry-helpers.js +0 -1
- package/lib/utilities/stream.js +11 -16
- package/lib/utilities/user.js +3 -4
- package/lib/utilities/validate-params.js +1 -2
- package/package.json +5 -6
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.symbol.description.js");
|
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
|
5
3
|
require("core-js/modules/esnext.function.metadata.js");
|
|
6
4
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
7
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -30,8 +28,6 @@ require("core-js/modules/esnext.map.merge.js");
|
|
|
30
28
|
require("core-js/modules/esnext.map.reduce.js");
|
|
31
29
|
require("core-js/modules/esnext.map.some.js");
|
|
32
30
|
require("core-js/modules/esnext.map.update.js");
|
|
33
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
34
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
35
31
|
var _imports = require("../../imports");
|
|
36
32
|
var _type = require("../../type");
|
|
37
33
|
var _user = require("../../utilities/user");
|
|
@@ -39,10 +35,7 @@ var _error = require("../../utilities/error");
|
|
|
39
35
|
var _logger = require("../../utilities/logger");
|
|
40
36
|
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
41
37
|
var _schema = require("../../schema");
|
|
42
|
-
|
|
43
|
-
let _initProto, _addLocalStreamsDecs, _bindLocalStreamsDecs, _updatePublishPrivilegeOfStreamsDecs, _removeStreamsDecs, _setVideoEncoderConfigDecs, _setScreenScenarioDecs, _startRenderRemoteVideoStreamDecs, _stopRenderRemoteVideoStreamDecs, _startPlayRemoteAudioStreamDecs, _stopPlayRemoteAudioStreamDecs, _takeSnapshotDecs, _addLocalScreenStreamDecs, _adjustRemoteAudioStreamVolumeDecs, _mergeAudioStreamDecs, _splitAudioStreamDecs, _ref;
|
|
44
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
45
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
38
|
+
let _initProto, _addLocalStreamsDecs, _bindLocalStreamsDecs, _updatePublishPrivilegeOfStreamsDecs, _removeStreamsDecs, _setVideoEncoderConfigDecs, _setScreenScenarioDecs, _startRenderRemoteVideoStreamDecs, _stopRenderRemoteVideoStreamDecs, _startPlayRemoteAudioStreamDecs, _stopPlayRemoteAudioStreamDecs, _takeSnapshotDecs, _addLocalScreenStreamDecs, _adjustRemoteAudioStreamVolumeDecs, _mergeAudioStreamDecs, _splitAudioStreamDecs;
|
|
46
39
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
47
40
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
48
41
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -51,148 +44,104 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
51
44
|
/**
|
|
52
45
|
* @internal
|
|
53
46
|
*/
|
|
54
|
-
_ref = (_addLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrLocalStreamCreateArrayConfigSchema)], _bindLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrStreamBindConfigArrySchema)], _updatePublishPrivilegeOfStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrUpdateStreamCustomSchema, _schema.fcrUpdateStreamPrivilegeScopeSchema.optional())], _removeStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _setVideoEncoderConfigDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.agoraRtcVideoEncoderConfigurationSchema, _schema.fcrVideoStreamTypeSchema)], _setScreenScenarioDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrScreenScenarioTypeSchema)], _startRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrVideoStreamTypeSchema, _schema.fcrRenderConfigSchema, (0, _schema.createUnionSchema)([_schema.fcrRenderViewSchema, _imports.objectSchema]))], _stopRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRenderViewSchema)], _startPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _stopPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _takeSnapshotDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _addLocalScreenStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrScreenStreamCreateConfigSchema, _schema.fcrSizeSchema)], _adjustRemoteAudioStreamVolumeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.numberSchema)], _mergeAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _splitAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger");
|
|
55
47
|
class FcrStreamControlImpl {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const exists = stream.streamId in this._streamMapByStreamId;
|
|
93
|
-
if (!exists) {
|
|
94
|
-
this.logger.warn("[FcrStreamControl] stream removed when the stream does not exist, streamId: ".concat(stream.streamId));
|
|
95
|
-
} else {
|
|
96
|
-
const index = this._streamList.findIndex(s => stream.streamId === s.streamId);
|
|
97
|
-
if (index !== -1) {
|
|
98
|
-
this._streamList.splice(index, 1);
|
|
99
|
-
}
|
|
100
|
-
delete this._streamMapByStreamId[stream.streamId];
|
|
101
|
-
this._deleteUserStream(stream.owner.userId, stream);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
this._observable.notifyObservers('onStreamsRemoved', sceneId, fcrStreamEvents);
|
|
105
|
-
},
|
|
106
|
-
onStreamsUpdated: (sceneId, events) => {
|
|
107
|
-
const fcrStreamEvents = events.map(this._convertStreamEvent);
|
|
108
|
-
fcrStreamEvents.forEach(event => {
|
|
109
|
-
const stream = event.modifiedStream;
|
|
110
|
-
const exists = stream.streamId in this._streamMapByStreamId;
|
|
111
|
-
if (!exists) {
|
|
112
|
-
this.logger.warn("[FcrStreamControl] stream updated when the stream does not exist, streamId: ".concat(stream.streamId));
|
|
113
|
-
} else {
|
|
114
|
-
const index = this._streamList.findIndex(s => stream.streamId === s.streamId);
|
|
115
|
-
if (index !== -1) {
|
|
116
|
-
this._streamList.splice(index, 1, stream);
|
|
117
|
-
}
|
|
118
|
-
this._streamMapByStreamId[stream.streamId] = stream;
|
|
119
|
-
this._setUserStream(stream.owner.userId, stream);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
this._observable.notifyObservers('onStreamsUpdated', sceneId, fcrStreamEvents);
|
|
123
|
-
},
|
|
124
|
-
onLocalVideoStatsUpdated: (sceneId, streamId, stats) => {
|
|
125
|
-
this._observable.notifyObservers('onLocalVideoStatsUpdated', sceneId, streamId, stats);
|
|
126
|
-
},
|
|
127
|
-
onLocalAudioStatsUpdated: (sceneId, streamId, stats) => {
|
|
128
|
-
this._observable.notifyObservers('onLocalAudioStatsUpdated', sceneId, streamId, stats);
|
|
129
|
-
},
|
|
130
|
-
onRemoteVideoStatsUpdated: (sceneId, streamId, stats) => {
|
|
131
|
-
this._observable.notifyObservers('onRemoteVideoStatsUpdated', sceneId, streamId, stats);
|
|
132
|
-
},
|
|
133
|
-
onRemoteAudioStatsUpdated: (sceneId, streamId, stats) => {
|
|
134
|
-
this._observable.notifyObservers('onRemoteAudioStatsUpdated', sceneId, streamId, stats);
|
|
135
|
-
},
|
|
136
|
-
onFirstRemoteVideoFrameRendered: (sceneId, streamId) => {
|
|
137
|
-
this._observable.notifyObservers('onFirstRemoteVideoFrameRendered', sceneId, streamId);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
//@internal
|
|
141
|
-
(0, _defineProperty2.default)(this, "_addSceneStreamPlayerObserver", {
|
|
142
|
-
onRemoteAudioStreamVolumeUpdated: (streamId, volume) => this._observable.notifyObservers('onStreamVolumeIndicationUpdated', this._scene.sceneId, streamId, volume)
|
|
143
|
-
});
|
|
144
|
-
(0, _defineProperty2.default)(this, "_convertStreamInfo", info => {
|
|
145
|
-
return {
|
|
146
|
-
streamId: info.streamId,
|
|
147
|
-
streamName: info.streamName,
|
|
148
|
-
owner: (0, _user.convertRteUserToFcrUser)(info.owner, this._roomCache),
|
|
149
|
-
streamType: info.streamType,
|
|
150
|
-
videoSourceType: info.videoSourceType,
|
|
151
|
-
audioSourceType: info.audioSourceType,
|
|
152
|
-
videoSourceState: info.videoSourceState,
|
|
153
|
-
audioSourceState: info.audioSourceState,
|
|
154
|
-
videoSourceId: info.videoSourceId,
|
|
155
|
-
audioSourceId: info.audioSourceId,
|
|
156
|
-
connectorType: info.connectorType
|
|
157
|
-
};
|
|
158
|
-
});
|
|
159
|
-
(0, _defineProperty2.default)(this, "_getPublishStateByPrivilege", privilege => {
|
|
160
|
-
return privilege === _imports.AgoraRteStreamPrivilegeOperation.HAS_PRIVILEGE ? 1 : privilege === _imports.AgoraRteStreamPrivilegeOperation.NOPRIVILEGE ? 0 : undefined;
|
|
161
|
-
});
|
|
162
|
-
(0, _defineProperty2.default)(this, "_convertStreamEvent", event => {
|
|
163
|
-
return {
|
|
164
|
-
modifiedStream: this._convertStreamInfo(event.modifiedStream),
|
|
165
|
-
operatorUser: event.operatorUser ? (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache) : undefined,
|
|
166
|
-
cause: event.cause
|
|
167
|
-
};
|
|
168
|
-
});
|
|
169
|
-
(0, _defineProperty2.default)(this, "_putUserStream", (userId, stream) => {
|
|
170
|
-
if (!this._streamMapByUserId[userId]) {
|
|
171
|
-
this._streamMapByUserId[userId] = [];
|
|
172
|
-
}
|
|
173
|
-
this._streamMapByUserId[userId].push(stream);
|
|
174
|
-
});
|
|
175
|
-
(0, _defineProperty2.default)(this, "_setUserStream", (userId, stream) => {
|
|
176
|
-
const streams = this._streamMapByUserId[userId];
|
|
177
|
-
if (streams) {
|
|
178
|
-
const index = streams.findIndex(s => s.streamId === stream.streamId);
|
|
179
|
-
if (index !== -1) {
|
|
180
|
-
streams.splice(index, 1, stream);
|
|
48
|
+
static {
|
|
49
|
+
[_initProto] = _applyDecs(this, [[_imports.bound, 2, "getStreams"], [_imports.bound, 2, "getStreamList"], [_imports.bound, 2, "getStreamsByUserId"], [_imports.bound, 2, "getStreamByStreamId"], [_addLocalStreamsDecs, 2, "addLocalStreams"], [_bindLocalStreamsDecs, 2, "bindLocalStreams"], [_updatePublishPrivilegeOfStreamsDecs, 2, "updatePublishPrivilegeOfStreams"], [_removeStreamsDecs, 2, "removeStreams"], [_setVideoEncoderConfigDecs, 2, "setVideoEncoderConfig"], [[_imports.bound, _imports.trace], 2, "setDualStreamMode"], [_setScreenScenarioDecs, 2, "setScreenScenario"], [_startRenderRemoteVideoStreamDecs, 2, "startRenderRemoteVideoStream"], [_stopRenderRemoteVideoStreamDecs, 2, "stopRenderRemoteVideoStream"], [_startPlayRemoteAudioStreamDecs, 2, "startPlayRemoteAudioStream"], [_stopPlayRemoteAudioStreamDecs, 2, "stopPlayRemoteAudioStream"], [_takeSnapshotDecs, 2, "takeSnapshot"], [_addLocalScreenStreamDecs, 2, "addLocalScreenStream"], [[_imports.bound, _imports.trace], 2, "removeScreenStream"], [_adjustRemoteAudioStreamVolumeDecs, 2, "adjustRemoteAudioStreamVolume"], [_mergeAudioStreamDecs, 2, "mergeAudioStream"], [_splitAudioStreamDecs, 2, "splitAudioStream"]], []).e;
|
|
50
|
+
}
|
|
51
|
+
//@internal
|
|
52
|
+
[(_addLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrLocalStreamCreateArrayConfigSchema)], _bindLocalStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrStreamBindConfigArrySchema)], _updatePublishPrivilegeOfStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrUpdateStreamCustomSchema, _schema.fcrUpdateStreamPrivilegeScopeSchema.optional())], _removeStreamsDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], _setVideoEncoderConfigDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.agoraRtcVideoEncoderConfigurationSchema, _schema.fcrVideoStreamTypeSchema)], _setScreenScenarioDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrScreenScenarioTypeSchema)], _startRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrVideoStreamTypeSchema, _schema.fcrRenderConfigSchema, (0, _schema.createUnionSchema)([_schema.fcrRenderViewSchema, _imports.objectSchema]))], _stopRenderRemoteVideoStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRenderViewSchema)], _startPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _stopPlayRemoteAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _takeSnapshotDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.stringSchema)], _addLocalScreenStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.fcrScreenStreamCreateConfigSchema, _schema.fcrSizeSchema)], _adjustRemoteAudioStreamVolumeDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.numberSchema)], _mergeAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _splitAudioStreamDecs = [_imports.bound, _imports.trace, (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
53
|
+
prefix: 'FcrStreamControlImpl'
|
|
54
|
+
}));
|
|
55
|
+
//@internal
|
|
56
|
+
_observable = new _imports.AgoraObservable();
|
|
57
|
+
//@internal
|
|
58
|
+
_streamMapByStreamId = {};
|
|
59
|
+
//@internal
|
|
60
|
+
_streamMapByUserId = {};
|
|
61
|
+
//@internal
|
|
62
|
+
_streamList = [];
|
|
63
|
+
//@internal
|
|
64
|
+
|
|
65
|
+
//@internal
|
|
66
|
+
_subscribedStreamsControl = new FcrSubscribedStreamsControl();
|
|
67
|
+
//@internal
|
|
68
|
+
|
|
69
|
+
//@internal
|
|
70
|
+
|
|
71
|
+
//@internal
|
|
72
|
+
_sceneObserver = {
|
|
73
|
+
onStreamsAdded: (sceneId, events) => {
|
|
74
|
+
const fcrStreamEvents = events.map(this._convertStreamEvent);
|
|
75
|
+
fcrStreamEvents.forEach(event => {
|
|
76
|
+
const stream = event.modifiedStream;
|
|
77
|
+
const exists = stream.streamId in this._streamMapByStreamId;
|
|
78
|
+
if (exists) {
|
|
79
|
+
this.logger.warn(`[FcrStreamControl] stream added when the stream already exists, streamId: ${stream.streamId}`);
|
|
80
|
+
} else {
|
|
81
|
+
this._streamList.push(stream);
|
|
82
|
+
this._streamMapByStreamId[stream.streamId] = stream;
|
|
83
|
+
this._putUserStream(stream.owner.userId, stream);
|
|
181
84
|
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
85
|
+
});
|
|
86
|
+
this._observable.notifyObservers('onStreamsAdded', sceneId, fcrStreamEvents);
|
|
87
|
+
},
|
|
88
|
+
onStreamsRemoved: (sceneId, events) => {
|
|
89
|
+
const fcrStreamEvents = events.map(this._convertStreamEvent);
|
|
90
|
+
fcrStreamEvents.forEach(event => {
|
|
91
|
+
const stream = event.modifiedStream;
|
|
92
|
+
const exists = stream.streamId in this._streamMapByStreamId;
|
|
93
|
+
if (!exists) {
|
|
94
|
+
this.logger.warn(`[FcrStreamControl] stream removed when the stream does not exist, streamId: ${stream.streamId}`);
|
|
95
|
+
} else {
|
|
96
|
+
const index = this._streamList.findIndex(s => stream.streamId === s.streamId);
|
|
97
|
+
if (index !== -1) {
|
|
98
|
+
this._streamList.splice(index, 1);
|
|
99
|
+
}
|
|
100
|
+
delete this._streamMapByStreamId[stream.streamId];
|
|
101
|
+
this._deleteUserStream(stream.owner.userId, stream);
|
|
190
102
|
}
|
|
191
|
-
|
|
192
|
-
|
|
103
|
+
});
|
|
104
|
+
this._observable.notifyObservers('onStreamsRemoved', sceneId, fcrStreamEvents);
|
|
105
|
+
},
|
|
106
|
+
onStreamsUpdated: (sceneId, events) => {
|
|
107
|
+
const fcrStreamEvents = events.map(this._convertStreamEvent);
|
|
108
|
+
fcrStreamEvents.forEach(event => {
|
|
109
|
+
const stream = event.modifiedStream;
|
|
110
|
+
const exists = stream.streamId in this._streamMapByStreamId;
|
|
111
|
+
if (!exists) {
|
|
112
|
+
this.logger.warn(`[FcrStreamControl] stream updated when the stream does not exist, streamId: ${stream.streamId}`);
|
|
113
|
+
} else {
|
|
114
|
+
const index = this._streamList.findIndex(s => stream.streamId === s.streamId);
|
|
115
|
+
if (index !== -1) {
|
|
116
|
+
this._streamList.splice(index, 1, stream);
|
|
117
|
+
}
|
|
118
|
+
this._streamMapByStreamId[stream.streamId] = stream;
|
|
119
|
+
this._setUserStream(stream.owner.userId, stream);
|
|
193
120
|
}
|
|
194
|
-
}
|
|
195
|
-
|
|
121
|
+
});
|
|
122
|
+
this._observable.notifyObservers('onStreamsUpdated', sceneId, fcrStreamEvents);
|
|
123
|
+
},
|
|
124
|
+
onLocalVideoStatsUpdated: (sceneId, streamId, stats) => {
|
|
125
|
+
this._observable.notifyObservers('onLocalVideoStatsUpdated', sceneId, streamId, stats);
|
|
126
|
+
},
|
|
127
|
+
onLocalAudioStatsUpdated: (sceneId, streamId, stats) => {
|
|
128
|
+
this._observable.notifyObservers('onLocalAudioStatsUpdated', sceneId, streamId, stats);
|
|
129
|
+
},
|
|
130
|
+
onRemoteVideoStatsUpdated: (sceneId, streamId, stats) => {
|
|
131
|
+
this._observable.notifyObservers('onRemoteVideoStatsUpdated', sceneId, streamId, stats);
|
|
132
|
+
},
|
|
133
|
+
onRemoteAudioStatsUpdated: (sceneId, streamId, stats) => {
|
|
134
|
+
this._observable.notifyObservers('onRemoteAudioStatsUpdated', sceneId, streamId, stats);
|
|
135
|
+
},
|
|
136
|
+
onFirstRemoteVideoFrameRendered: (sceneId, streamId) => {
|
|
137
|
+
this._observable.notifyObservers('onFirstRemoteVideoFrameRendered', sceneId, streamId);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
//@internal
|
|
141
|
+
_addSceneStreamPlayerObserver = {
|
|
142
|
+
onRemoteAudioStreamVolumeUpdated: (streamId, volume) => this._observable.notifyObservers('onStreamVolumeIndicationUpdated', this._scene.sceneId, streamId, volume)
|
|
143
|
+
};
|
|
144
|
+
constructor(_engine, _scene, _api, _sharedCache) {
|
|
196
145
|
this._engine = _engine;
|
|
197
146
|
this._scene = _scene;
|
|
198
147
|
this._api = _api;
|
|
@@ -231,20 +180,18 @@ class FcrStreamControlImpl {
|
|
|
231
180
|
}
|
|
232
181
|
}
|
|
233
182
|
async addLocalStreams(streams) {
|
|
234
|
-
const streamCreateResult = await (0, _error.handleRequestError)(() => this._api.createStreamBatch(this._scene.sceneId, streams.map(config => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}, (0, _imports.convertStreamTypeToPublishState)(config.streamType));
|
|
247
|
-
})), _error.FcrErrorModuleCode.ROOM_STREAM, 'add local streams failed');
|
|
183
|
+
const streamCreateResult = await (0, _error.handleRequestError)(() => this._api.createStreamBatch(this._scene.sceneId, streams.map(config => ({
|
|
184
|
+
streamName: config.streamName,
|
|
185
|
+
streamUuid: '0',
|
|
186
|
+
// means that this stream needs to be created
|
|
187
|
+
generateToken: config.generateToken ?? config.videoSourceType === _imports.AgoraRteVideoSourceType.SCREEN,
|
|
188
|
+
userUuid: config.ownerId,
|
|
189
|
+
videoSourceType: config.videoSourceType,
|
|
190
|
+
audioSourceType: config.audioSourceType,
|
|
191
|
+
videoSourceUuid: config.videoSourceId,
|
|
192
|
+
audioSourceUuid: config.audioSourceId,
|
|
193
|
+
...(0, _imports.convertStreamTypeToPublishState)(config.streamType)
|
|
194
|
+
}))), _error.FcrErrorModuleCode.ROOM_STREAM, 'add local streams failed');
|
|
248
195
|
|
|
249
196
|
// 处理需要 token 的流
|
|
250
197
|
this._handleStreamTokensPreparation(streams, streamCreateResult.data);
|
|
@@ -280,10 +227,7 @@ class FcrStreamControlImpl {
|
|
|
280
227
|
bindLocalStreams(streams) {
|
|
281
228
|
return this._scene.localUser.bindLocalStreams(streams);
|
|
282
229
|
}
|
|
283
|
-
updatePublishPrivilegeOfStreams() {
|
|
284
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
285
|
-
args[_key] = arguments[_key];
|
|
286
|
-
}
|
|
230
|
+
updatePublishPrivilegeOfStreams(...args) {
|
|
287
231
|
if (args.length === 1) {
|
|
288
232
|
const privileges = args[0];
|
|
289
233
|
return (0, _error.handleRequestError)(() => this._api.updateStreamBatch(this._scene.sceneId, Object.keys(privileges).map(streamId => ({
|
|
@@ -337,20 +281,20 @@ class FcrStreamControlImpl {
|
|
|
337
281
|
}
|
|
338
282
|
startRenderRemoteVideoStream(streamId, type, config, element) {
|
|
339
283
|
const startTime = Date.now();
|
|
340
|
-
const parameters =
|
|
284
|
+
const parameters = `streamId: ${streamId}, config: ${JSON.stringify(config)}, type: ${type}, element: ${element}`;
|
|
341
285
|
this._scene.streamPlayer.subscribeRemoteVideoStream(streamId, type);
|
|
342
286
|
try {
|
|
343
287
|
this._scene.streamPlayer.startRenderRemoteVideoStream(streamId, config.renderMode, config.isMirror, element);
|
|
344
288
|
const viewId = this._subscribedStreamsControl.getViewId(element);
|
|
345
289
|
this._subscribedStreamsControl.bind(viewId, streamId);
|
|
346
290
|
} catch (error) {
|
|
347
|
-
this.logger.error(
|
|
291
|
+
this.logger.error(`[FcrStreamControl][start-render-remote-video-stream] render failed, streamId: ${streamId}, error: ${error}, parameters: ${parameters}, duration: ${Date.now() - startTime}ms`);
|
|
348
292
|
throw error;
|
|
349
293
|
}
|
|
350
294
|
}
|
|
351
295
|
stopRenderRemoteVideoStream(streamId, element) {
|
|
352
296
|
const startTime = Date.now();
|
|
353
|
-
const parameters =
|
|
297
|
+
const parameters = `streamId: ${streamId}, element: ${element}`;
|
|
354
298
|
try {
|
|
355
299
|
this._scene.streamPlayer.stopRenderRemoteVideoStream(streamId, element);
|
|
356
300
|
const viewId = this._subscribedStreamsControl.getViewId(element);
|
|
@@ -359,10 +303,10 @@ class FcrStreamControlImpl {
|
|
|
359
303
|
if (shouldUnsubscribe) {
|
|
360
304
|
this._scene.streamPlayer.unsubscribeRemoteVideoStream(streamId);
|
|
361
305
|
} else {
|
|
362
|
-
this.logger.info(
|
|
306
|
+
this.logger.info(`[FcrStreamControl][unsubscribe-remote-video-stream] still has other views, do not unsubscribe, streamId: ${streamId}, parameters: ${parameters}, duration: ${Date.now() - startTime}ms`);
|
|
363
307
|
}
|
|
364
308
|
} catch (error) {
|
|
365
|
-
this.logger.error(
|
|
309
|
+
this.logger.error(`[FcrStreamControl][stop-render-remote-video-stream] stop render failed, streamId: ${streamId}, error: ${error}, parameters: ${parameters}, duration: ${Date.now() - startTime}ms`);
|
|
366
310
|
throw error;
|
|
367
311
|
}
|
|
368
312
|
}
|
|
@@ -375,18 +319,18 @@ class FcrStreamControlImpl {
|
|
|
375
319
|
takeSnapshot(streamId, filePath) {
|
|
376
320
|
return this._scene.streamPlayer.takeSnapshot(streamId, filePath);
|
|
377
321
|
}
|
|
378
|
-
async addLocalScreenStream(config, size) {
|
|
322
|
+
async addLocalScreenStream(config, size, labels) {
|
|
379
323
|
const res = await (0, _error.handleRequestError)(() => this._api.startShareScreen({
|
|
380
324
|
roomId: this._scene.sceneId,
|
|
381
325
|
userId: this._scene.getLocalUser().getLocalUserId(),
|
|
382
|
-
config:
|
|
326
|
+
config: {
|
|
383
327
|
videoSourceType: _type.FcrVideoSourceType.SCREEN,
|
|
384
328
|
audioSourceType: _type.FcrAudioSourceType.LOOPBACK,
|
|
385
329
|
videoSourceState: _type.FcrMediaSourceState.CLOSE,
|
|
386
330
|
audioSourceState: _type.FcrMediaSourceState.CLOSE,
|
|
387
331
|
videoSourceUuid: config.videoSourceId,
|
|
388
|
-
audioSourceUuid: config.audioSourceId
|
|
389
|
-
|
|
332
|
+
audioSourceUuid: config.audioSourceId,
|
|
333
|
+
...(0, _imports.convertStreamTypeToPublishState)(config.streamType),
|
|
390
334
|
annotation: size ? {
|
|
391
335
|
size: {
|
|
392
336
|
width: size.width,
|
|
@@ -398,7 +342,7 @@ class FcrStreamControlImpl {
|
|
|
398
342
|
height: 0
|
|
399
343
|
}
|
|
400
344
|
}
|
|
401
|
-
}
|
|
345
|
+
}
|
|
402
346
|
}), _error.FcrErrorModuleCode.ROOM_STREAM, 'add local screen stream failed');
|
|
403
347
|
const {
|
|
404
348
|
data: {
|
|
@@ -408,6 +352,10 @@ class FcrStreamControlImpl {
|
|
|
408
352
|
} = res;
|
|
409
353
|
this._screenStreamId = streamId;
|
|
410
354
|
this._scene.localUser.prepareToPublishStream(streamId, token);
|
|
355
|
+
if (labels) {
|
|
356
|
+
// add label to scene
|
|
357
|
+
this._scene.addLocalStreamLabels(streamId, labels);
|
|
358
|
+
}
|
|
411
359
|
return streamId;
|
|
412
360
|
}
|
|
413
361
|
async removeScreenStream() {
|
|
@@ -418,6 +366,7 @@ class FcrStreamControlImpl {
|
|
|
418
366
|
});
|
|
419
367
|
}, _error.FcrErrorModuleCode.ROOM_STREAM, 'remove screen stream failed');
|
|
420
368
|
if (this._screenStreamId) {
|
|
369
|
+
this._scene.removeLocalStreamLabel(this._screenStreamId);
|
|
421
370
|
this._scene.localUser.removePreparePublishStream(this._screenStreamId);
|
|
422
371
|
}
|
|
423
372
|
return res;
|
|
@@ -453,14 +402,65 @@ class FcrStreamControlImpl {
|
|
|
453
402
|
this._observable.removeObserver(observer);
|
|
454
403
|
}
|
|
455
404
|
async findSelectionByParamId(paramSourceId) {
|
|
456
|
-
|
|
457
|
-
const
|
|
458
|
-
const displays = (await ((_this$_mediaControl2 = this._mediaControl) === null || _this$_mediaControl2 === void 0 ? void 0 : _this$_mediaControl2.getDisplayList())) || [];
|
|
405
|
+
const wins = (await this._mediaControl?.getWindowList()) || [];
|
|
406
|
+
const displays = (await this._mediaControl?.getDisplayList()) || [];
|
|
459
407
|
const findInList = list => list.find(item => item.id === paramSourceId);
|
|
460
408
|
const winMatch = findInList(wins);
|
|
461
409
|
const displayMatch = findInList(displays);
|
|
462
410
|
return winMatch || displayMatch || null;
|
|
463
411
|
}
|
|
412
|
+
_convertStreamInfo = info => {
|
|
413
|
+
return {
|
|
414
|
+
streamId: info.streamId,
|
|
415
|
+
streamName: info.streamName,
|
|
416
|
+
owner: (0, _user.convertRteUserToFcrUser)(info.owner, this._roomCache),
|
|
417
|
+
streamType: info.streamType,
|
|
418
|
+
videoSourceType: info.videoSourceType,
|
|
419
|
+
audioSourceType: info.audioSourceType,
|
|
420
|
+
videoSourceState: info.videoSourceState,
|
|
421
|
+
audioSourceState: info.audioSourceState,
|
|
422
|
+
videoSourceId: info.videoSourceId,
|
|
423
|
+
audioSourceId: info.audioSourceId,
|
|
424
|
+
connectorType: info.connectorType
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
_getPublishStateByPrivilege = privilege => {
|
|
428
|
+
return privilege === _imports.AgoraRteStreamPrivilegeOperation.HAS_PRIVILEGE ? 1 : privilege === _imports.AgoraRteStreamPrivilegeOperation.NOPRIVILEGE ? 0 : undefined;
|
|
429
|
+
};
|
|
430
|
+
_convertStreamEvent = event => {
|
|
431
|
+
return {
|
|
432
|
+
modifiedStream: this._convertStreamInfo(event.modifiedStream),
|
|
433
|
+
operatorUser: event.operatorUser ? (0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache) : undefined,
|
|
434
|
+
cause: event.cause
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
_putUserStream = (userId, stream) => {
|
|
438
|
+
if (!this._streamMapByUserId[userId]) {
|
|
439
|
+
this._streamMapByUserId[userId] = [];
|
|
440
|
+
}
|
|
441
|
+
this._streamMapByUserId[userId].push(stream);
|
|
442
|
+
};
|
|
443
|
+
_setUserStream = (userId, stream) => {
|
|
444
|
+
const streams = this._streamMapByUserId[userId];
|
|
445
|
+
if (streams) {
|
|
446
|
+
const index = streams.findIndex(s => s.streamId === stream.streamId);
|
|
447
|
+
if (index !== -1) {
|
|
448
|
+
streams.splice(index, 1, stream);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
_deleteUserStream = (userId, stream) => {
|
|
453
|
+
const userStreams = this._streamMapByUserId[userId];
|
|
454
|
+
if (userStreams) {
|
|
455
|
+
const index = userStreams.findIndex(s => s.streamId === stream.streamId);
|
|
456
|
+
if (index !== -1) {
|
|
457
|
+
userStreams.splice(index, 1);
|
|
458
|
+
}
|
|
459
|
+
if (userStreams.length === 0) {
|
|
460
|
+
delete this._streamMapByUserId[userId];
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
464
|
_addLogObserver() {
|
|
465
465
|
this.addObserver((0, _logger.generateLogObserver)(this.logger, [
|
|
466
466
|
// 'onLocalVideoStatsUpdated',
|
|
@@ -473,21 +473,17 @@ class FcrStreamControlImpl {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
exports.FcrStreamControlImpl = FcrStreamControlImpl;
|
|
476
|
-
_FcrStreamControlImpl = FcrStreamControlImpl;
|
|
477
|
-
[_initProto] = _applyDecs(_FcrStreamControlImpl, [[_imports.bound, 2, "getStreams"], [_imports.bound, 2, "getStreamList"], [_imports.bound, 2, "getStreamsByUserId"], [_imports.bound, 2, "getStreamByStreamId"], [_addLocalStreamsDecs, 2, "addLocalStreams"], [_bindLocalStreamsDecs, 2, "bindLocalStreams"], [_updatePublishPrivilegeOfStreamsDecs, 2, "updatePublishPrivilegeOfStreams"], [_removeStreamsDecs, 2, "removeStreams"], [_setVideoEncoderConfigDecs, 2, "setVideoEncoderConfig"], [[_imports.bound, _imports.trace], 2, "setDualStreamMode"], [_setScreenScenarioDecs, 2, "setScreenScenario"], [_startRenderRemoteVideoStreamDecs, 2, "startRenderRemoteVideoStream"], [_stopRenderRemoteVideoStreamDecs, 2, "stopRenderRemoteVideoStream"], [_startPlayRemoteAudioStreamDecs, 2, "startPlayRemoteAudioStream"], [_stopPlayRemoteAudioStreamDecs, 2, "stopPlayRemoteAudioStream"], [_takeSnapshotDecs, 2, "takeSnapshot"], [_addLocalScreenStreamDecs, 2, "addLocalScreenStream"], [[_imports.bound, _imports.trace], 2, "removeScreenStream"], [_adjustRemoteAudioStreamVolumeDecs, 2, "adjustRemoteAudioStreamVolume"], [_mergeAudioStreamDecs, 2, "mergeAudioStream"], [_splitAudioStreamDecs, 2, "splitAudioStream"]], []).e;
|
|
478
476
|
class FcrSubscribedStreamsControl {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
(0, _defineProperty2.default)(this, "_remoteSubscribedStreamRenderMap", new Map());
|
|
490
|
-
}
|
|
477
|
+
logger = (0, _logger.createLogger)({
|
|
478
|
+
prefix: 'StreamSubscriptionManager'
|
|
479
|
+
});
|
|
480
|
+
//@internal
|
|
481
|
+
/**
|
|
482
|
+
* Map of remote subscribed streams to their bound view IDs
|
|
483
|
+
* key: streamId - The ID of the remote video stream
|
|
484
|
+
* value: string[] - Array of viewIds bound to this stream
|
|
485
|
+
*/
|
|
486
|
+
_remoteSubscribedStreamRenderMap = new Map();
|
|
491
487
|
getViewId(element) {
|
|
492
488
|
// Adapt for harmony: AgoraRteRenderView is string in harmony, HTMLElement in web
|
|
493
489
|
if (typeof element === 'string') {
|
|
@@ -510,7 +506,7 @@ class FcrSubscribedStreamsControl {
|
|
|
510
506
|
}
|
|
511
507
|
bind(viewId, streamId) {
|
|
512
508
|
if (!streamId || !viewId) {
|
|
513
|
-
this.logger.warn(
|
|
509
|
+
this.logger.warn(`[FcrStreamControl][bind-view-to-stream] invalid parameters, streamId: ${streamId}, viewId: ${viewId}`);
|
|
514
510
|
return;
|
|
515
511
|
}
|
|
516
512
|
const viewIds = this._remoteSubscribedStreamRenderMap.get(streamId) || [];
|
|
@@ -519,17 +515,17 @@ class FcrSubscribedStreamsControl {
|
|
|
519
515
|
viewIds.push(viewId);
|
|
520
516
|
this._remoteSubscribedStreamRenderMap.set(streamId, viewIds);
|
|
521
517
|
} else {
|
|
522
|
-
this.logger.warn(
|
|
518
|
+
this.logger.warn(`[FcrStreamControl][bind-view-to-stream] viewId already bound, streamId: ${streamId}, viewId: ${viewId}`);
|
|
523
519
|
}
|
|
524
520
|
}
|
|
525
521
|
unbind(viewId, streamId) {
|
|
526
522
|
if (!streamId || !viewId) {
|
|
527
|
-
this.logger.warn(
|
|
523
|
+
this.logger.warn(`[FcrStreamControl][unbind-view-from-stream] invalid parameters, streamId: ${streamId}, viewId: ${viewId}`);
|
|
528
524
|
return;
|
|
529
525
|
}
|
|
530
526
|
const viewIds = this._remoteSubscribedStreamRenderMap.get(streamId);
|
|
531
527
|
if (!viewIds || !viewIds.includes(viewId)) {
|
|
532
|
-
this.logger.warn(
|
|
528
|
+
this.logger.warn(`[FcrStreamControl][unbind-view-from-stream] viewId not found, streamId: ${streamId}, viewId: ${viewId}`);
|
|
533
529
|
return;
|
|
534
530
|
}
|
|
535
531
|
const rest = viewIds.filter(id => id !== viewId);
|
|
@@ -114,7 +114,7 @@ export interface FcrStreamControl {
|
|
|
114
114
|
* Adds a local screen stream.
|
|
115
115
|
* @param config
|
|
116
116
|
*/
|
|
117
|
-
addLocalScreenStream(config: FcrScreenStreamCreateConfig, size?: FcrSize): Promise<string>;
|
|
117
|
+
addLocalScreenStream(config: FcrScreenStreamCreateConfig, size?: FcrSize, label?: Map<string, any>): Promise<string>;
|
|
118
118
|
/**
|
|
119
119
|
* Removes the local screen stream.
|
|
120
120
|
*/
|
|
@@ -4,16 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.deCompressGzipToJson = deCompressGzipToJson;
|
|
7
|
-
require("core-js/modules/es.error.cause.js");
|
|
8
|
-
require("core-js/modules/es.array-buffer.constructor.js");
|
|
9
|
-
require("core-js/modules/es.array-buffer.slice.js");
|
|
10
|
-
require("core-js/modules/es.typed-array.uint8-array.js");
|
|
11
|
-
require("core-js/modules/es.typed-array.at.js");
|
|
12
|
-
require("core-js/modules/es.typed-array.fill.js");
|
|
13
|
-
require("core-js/modules/es.typed-array.find-last.js");
|
|
14
|
-
require("core-js/modules/es.typed-array.find-last-index.js");
|
|
15
|
-
require("core-js/modules/es.typed-array.set.js");
|
|
16
|
-
require("core-js/modules/es.typed-array.sort.js");
|
|
17
7
|
require("core-js/modules/es.typed-array.to-reversed.js");
|
|
18
8
|
require("core-js/modules/es.typed-array.to-sorted.js");
|
|
19
9
|
require("core-js/modules/es.typed-array.with.js");
|