fcr-ui-scene 3.7.7 → 3.7.8
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/installer/icons/icon.png +0 -0
- package/installer/mac/entitlements.mac.plist +5 -1
- package/lib/creator/provider-initializer.browser.js +2 -2
- package/lib/creator/provider-initializer.electron.js +2 -2
- package/lib/electron/bootstrap-sdk.js +70 -33
- package/lib/electron/hang-detection/index.d.ts +3 -0
- package/lib/electron/hang-detection/index.js +15 -0
- package/lib/electron/hang-detection/manager.d.ts +28 -0
- package/lib/electron/hang-detection/manager.js +231 -0
- package/lib/electron/hang-detection/types.d.ts +14 -0
- package/lib/electron/hang-detection/types.js +6 -0
- package/lib/electron/until.d.ts +1 -4
- package/lib/electron/until.js +9 -4
- package/lib/modules/action-bar/components/screen-share/index.electron.js +1 -1
- package/lib/modules/action-bar/index.d.ts +0 -2
- package/lib/modules/action-bar/index.js +1 -2
- package/lib/modules/action-bar/store.d.ts +3 -6
- package/lib/modules/action-bar/store.js +96 -53
- package/lib/modules/annotation/store.js +10 -9
- package/lib/modules/components/control-bar/components/switch-theme/index.js +4 -2
- package/lib/modules/components/control-bar/index.js +1 -3
- package/lib/modules/event-confirm/components/window/index.d.ts +2 -5
- package/lib/modules/event-confirm/components/window/index.js +14 -38
- package/lib/modules/event-confirm/store.d.ts +5 -10
- package/lib/modules/event-confirm/store.js +13 -62
- package/lib/modules/event-confirm/view.js +7 -9
- package/lib/modules/layout/store.js +22 -8
- package/lib/modules/participant/store.base.js +0 -1
- package/lib/modules/participant/store.js +12 -14
- package/lib/modules/share-screen/store.d.ts +1 -1
- package/lib/modules/share-screen/store.electron.js +9 -0
- package/lib/modules/share-screen/store.js +4 -14
- package/lib/modules/state-bar/store.base.electron.js +6 -2
- package/lib/providers/board-share/bar-control/base.d.ts +2 -0
- package/lib/providers/board-share/bar-control/base.js +13 -3
- package/lib/providers/board-share/bar-control/electron.d.ts +1 -0
- package/lib/providers/board-share/bar-control/electron.js +15 -4
- package/lib/providers/board-share/provider.base.d.ts +1 -0
- package/lib/providers/board-share/provider.base.js +3 -1
- package/lib/providers/board-share/provider.electron.d.ts +1 -0
- package/lib/providers/board-share/provider.electron.js +8 -2
- package/lib/providers/board-share/type.d.ts +2 -0
- package/lib/providers/dialog/provider.electron.js +10 -2
- package/lib/providers/screen-share/strategy/browser.js +50 -3
- package/lib/providers/screen-share/strategy/electron.js +77 -8
- package/lib/providers/screen-share/stream-state-sync.d.ts +3 -1
- package/lib/providers/screen-share/stream-state-sync.js +133 -40
- package/lib/providers/screen-share-provider.d.ts +7 -8
- package/lib/providers/screen-share-provider.js +70 -85
- package/lib/providers/sharing-provider.js +0 -7
- package/lib/providers/whiteboard-provider.js +0 -1
- package/lib/shared-data-source/confirm-data.d.ts +0 -19
- package/lib/shared-data-source/confirm-data.js +15 -119
- package/lib/shared-data-source/screen-share-data.d.ts +17 -10
- package/lib/shared-data-source/screen-share-data.js +16 -9
- package/lib/shared-data-source/whiteboard-data.d.ts +5 -7
- package/lib/shared-data-source/whiteboard-data.js +8 -9
- package/package.json +5 -5
|
@@ -84,7 +84,7 @@ export interface FcrUIScreenShareProvider {
|
|
|
84
84
|
* @param isReplace - 是否替换当前已有的共享
|
|
85
85
|
* @returns 返回一个Promise,成功时解析为屏幕共享轨道对象,失败时返回null
|
|
86
86
|
*/
|
|
87
|
-
startShareScreen(id: string, type: FcrScreenCaptureType, withAudio: boolean, isReplace: boolean): Promise<
|
|
87
|
+
startShareScreen(id: string, type: FcrScreenCaptureType, withAudio: boolean, isReplace: boolean): Promise<FcrScreenTrack | null>;
|
|
88
88
|
/**
|
|
89
89
|
* 停止屏幕共享
|
|
90
90
|
* @param targetScreenTrack - 可选参数,要停止的屏幕共享轨道对象,默认停止当前活动的共享
|
|
@@ -173,13 +173,13 @@ export declare class FcrUIScreenShareProviderImpl implements FcrUIScreenSharePro
|
|
|
173
173
|
private _privilegeProvider;
|
|
174
174
|
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
175
175
|
shareLock: boolean;
|
|
176
|
-
private _sharingControl
|
|
176
|
+
private _sharingControl?;
|
|
177
177
|
private _previewDom;
|
|
178
178
|
private _prevFullScalc;
|
|
179
179
|
private _observable;
|
|
180
180
|
private _streamObserver;
|
|
181
181
|
private _screenCaptureObserver;
|
|
182
|
-
private _streamControl
|
|
182
|
+
private _streamControl?;
|
|
183
183
|
private _maxScalcValue;
|
|
184
184
|
private _minScalcValue;
|
|
185
185
|
private _diffScalcValue;
|
|
@@ -194,7 +194,6 @@ export declare class FcrUIScreenShareProviderImpl implements FcrUIScreenSharePro
|
|
|
194
194
|
height: number;
|
|
195
195
|
};
|
|
196
196
|
get screenShareScenarioType(): FcrScreenScenarioType;
|
|
197
|
-
private get _currentRoomControl();
|
|
198
197
|
constructor(_deviceProvider: FcrUIDeviceProvider, _eventProvider: FcrUIEventProvider, _roomProvider: FcrUIRoomProvider, _sharingProvider: FcrUISharingProvider, _sharedScreenShareSharedDataSource: FcrUIScreenShareSharedDataSource, _sharedMemberDataSource: FcrUIMemberSharedDataSourceImpl, _privilegeProvider: FcrUIPrivilegeProvider);
|
|
199
198
|
setSharingInReplace(isInReplace: boolean): void;
|
|
200
199
|
zoomOut(): void;
|
|
@@ -208,13 +207,15 @@ export declare class FcrUIScreenShareProviderImpl implements FcrUIScreenSharePro
|
|
|
208
207
|
bootstrap(): void;
|
|
209
208
|
private _handleWebScreenCaptureStateUpdated;
|
|
210
209
|
private _handleScreenCaptureStateUpdated;
|
|
210
|
+
private _handleShareStopWithAudio;
|
|
211
211
|
replaceScreenShare(id: string, type: FcrScreenCaptureType, withAudio: boolean, bounds: CurrentShareBounds): void;
|
|
212
212
|
private _handleRemoteVideoStatsUpdated;
|
|
213
213
|
get localUserId(): string;
|
|
214
214
|
get shareAudioTrack(): import("fcr-core/lib/media-control/type").FcrLoopbackTrack | null;
|
|
215
|
+
get loopbackAudioSourceId(): string;
|
|
215
216
|
get currentShareId(): string;
|
|
216
217
|
get screenTrack(): FcrScreenTrack | null;
|
|
217
|
-
get currentShareStreamId(): string
|
|
218
|
+
get currentShareStreamId(): string;
|
|
218
219
|
get currentSelectionBounds(): CurrentShareBounds;
|
|
219
220
|
setShareLock(lock: boolean): void;
|
|
220
221
|
createScreenShareWithSelectionId(videoSourceId: string, bounds: CurrentShareBounds): Promise<string>;
|
|
@@ -231,11 +232,9 @@ export declare class FcrUIScreenShareProviderImpl implements FcrUIScreenSharePro
|
|
|
231
232
|
removeObserver(observer: FcrUIScreenShareObserver): void;
|
|
232
233
|
startShareWhiteboard(): void;
|
|
233
234
|
release(): void;
|
|
234
|
-
startShareScreen(id: string, type: FcrScreenCaptureType, withAudio: boolean, isReplace: boolean): Promise<
|
|
235
|
+
startShareScreen(id: string, type: FcrScreenCaptureType, withAudio: boolean, isReplace: boolean): Promise<FcrScreenTrack | null>;
|
|
235
236
|
stopShareScreen(targetScreenTrack?: FcrScreenTrack | null | undefined): void;
|
|
236
237
|
stopShareScreenByExitRoom(targetScreenTrack?: FcrScreenTrack | null | undefined): void;
|
|
237
|
-
private _updateShareAudioPrivilege;
|
|
238
|
-
private _handleShareStopWithAudio;
|
|
239
238
|
private _handleShareStartWithAudio;
|
|
240
239
|
toggleScreenshareWithAudio(withAudio: boolean): void;
|
|
241
240
|
private _getExcludeWindows;
|
|
@@ -78,16 +78,19 @@ var _constant = require("../utilities/constant");
|
|
|
78
78
|
var _lodash = require("lodash");
|
|
79
79
|
var _config = require("../modules/setting/config");
|
|
80
80
|
var _FcrUIScreenShareProviderImpl;
|
|
81
|
-
var _initProto, _zoomOutDecs, _zoomInDecs, _fullContainerDecs, _setOriginScalcDecs, _handleScreenCaptureStateUpdatedDecs, _replaceScreenShareDecs, _handleRemoteVideoStatsUpdatedDecs, _handleStreamUpdateDecs, _syncScreenShareStreamInfosDecs, _releaseDecs, _startShareScreenDecs,
|
|
81
|
+
var _initProto, _zoomOutDecs, _zoomInDecs, _fullContainerDecs, _setOriginScalcDecs, _handleScreenCaptureStateUpdatedDecs, _handleShareStopWithAudioDecs, _replaceScreenShareDecs, _handleRemoteVideoStatsUpdatedDecs, _handleStreamUpdateDecs, _syncScreenShareStreamInfosDecs, _releaseDecs, _startShareScreenDecs, _handleShareStartWithAudioDecs, _ref;
|
|
82
82
|
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 set(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 k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(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 s(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)]; } }; }
|
|
83
83
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
84
84
|
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); }
|
|
85
85
|
function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
86
86
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
|
|
87
|
-
_ref = (_zoomOutDecs = [_mobx.action, _mobx.action.bound], _zoomInDecs = [_mobx.action, _mobx.action.bound], _fullContainerDecs = [_mobx.action, _mobx.action.bound], _setOriginScalcDecs = [_mobx.action, _mobx.action.bound], _handleScreenCaptureStateUpdatedDecs = [_mobx.action, _mobx.action.bound],
|
|
87
|
+
_ref = (_zoomOutDecs = [_mobx.action, _mobx.action.bound], _zoomInDecs = [_mobx.action, _mobx.action.bound], _fullContainerDecs = [_mobx.action, _mobx.action.bound], _setOriginScalcDecs = [_mobx.action, _mobx.action.bound], _handleScreenCaptureStateUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleShareStopWithAudioDecs = [_mobx.action, _mobx.action.bound], _replaceScreenShareDecs = [_mobx.action, _mobx.action.bound], _handleRemoteVideoStatsUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleStreamUpdateDecs = [_mobx.action, _mobx.action.bound], _syncScreenShareStreamInfosDecs = [_mobx.action, _mobx.action.bound], _releaseDecs = [_mobx.action, _mobx.action.bound], _startShareScreenDecs = [_mobx.action, _mobx.action.bound], _handleShareStartWithAudioDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
88
88
|
var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__PURE__*/function () {
|
|
89
89
|
function FcrUIScreenShareProviderImpl(_deviceProvider, _eventProvider, _roomProvider, _sharingProvider, _sharedScreenShareSharedDataSource, _sharedMemberDataSource, _privilegeProvider) {
|
|
90
|
-
var _this = this
|
|
90
|
+
var _this = this,
|
|
91
|
+
_this$_roomProvider$c,
|
|
92
|
+
_this$_roomProvider$c2,
|
|
93
|
+
_this$_streamControl;
|
|
91
94
|
(0, _classCallCheck2["default"])(this, FcrUIScreenShareProviderImpl);
|
|
92
95
|
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
93
96
|
prefix: 'FcrUIScreenShareProviderImpl'
|
|
@@ -127,9 +130,9 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
127
130
|
this._sharedScreenShareSharedDataSource = _sharedScreenShareSharedDataSource;
|
|
128
131
|
this._sharedMemberDataSource = _sharedMemberDataSource;
|
|
129
132
|
this._privilegeProvider = _privilegeProvider;
|
|
130
|
-
this._sharingControl = this.
|
|
131
|
-
this._streamControl = this.
|
|
132
|
-
this._streamControl.addObserver(this._streamObserver);
|
|
133
|
+
this._sharingControl = (_this$_roomProvider$c = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c === void 0 ? void 0 : _this$_roomProvider$c.getSharingControl();
|
|
134
|
+
this._streamControl = (_this$_roomProvider$c2 = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c2 === void 0 ? void 0 : _this$_roomProvider$c2.getStreamControl();
|
|
135
|
+
(_this$_streamControl = this._streamControl) === null || _this$_streamControl === void 0 || _this$_streamControl.addObserver(this._streamObserver);
|
|
133
136
|
this._syncScreenShareStreamInfos();
|
|
134
137
|
this._addEventListeners();
|
|
135
138
|
this._syncShareStreamState();
|
|
@@ -164,15 +167,6 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
164
167
|
get: function get() {
|
|
165
168
|
return this._sharedScreenShareSharedDataSource.screenShareScenarioType;
|
|
166
169
|
}
|
|
167
|
-
}, {
|
|
168
|
-
key: "_currentRoomControl",
|
|
169
|
-
get: function get() {
|
|
170
|
-
var currentRoomControl = this._roomProvider.currentRoomControl;
|
|
171
|
-
if (!currentRoomControl) {
|
|
172
|
-
throw new Error('currentRoomControl is not initialized');
|
|
173
|
-
}
|
|
174
|
-
return currentRoomControl;
|
|
175
|
-
}
|
|
176
170
|
}, {
|
|
177
171
|
key: "setSharingInReplace",
|
|
178
172
|
value: function setSharingInReplace(isInReplace) {
|
|
@@ -228,8 +222,9 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
228
222
|
}, {
|
|
229
223
|
key: "currentScreenSharingOwner",
|
|
230
224
|
get: function get() {
|
|
231
|
-
var
|
|
232
|
-
var
|
|
225
|
+
var _this$_streamControl2;
|
|
226
|
+
var allStreams = (_this$_streamControl2 = this._streamControl) === null || _this$_streamControl2 === void 0 ? void 0 : _this$_streamControl2.getStreamList();
|
|
227
|
+
var screenShareStream = allStreams === null || allStreams === void 0 ? void 0 : allStreams.find(function (stream) {
|
|
233
228
|
return stream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN && (stream.streamType === _type.FcrStreamType.BOTH || stream.streamType === _type.FcrStreamType.VIDEO);
|
|
234
229
|
});
|
|
235
230
|
if (screenShareStream) {
|
|
@@ -332,6 +327,17 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
332
327
|
}
|
|
333
328
|
this._sharedScreenShareSharedDataSource.setLocalUserScreenSharingState(state);
|
|
334
329
|
}
|
|
330
|
+
}, {
|
|
331
|
+
key: "_handleShareStopWithAudio",
|
|
332
|
+
value: function _handleShareStopWithAudio() {
|
|
333
|
+
if (!this.shareAudioTrack) {
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE)) {
|
|
337
|
+
this.logger.info('[screen-share-provider][handleShareStopWithAudio] shareAudioTrack.stop');
|
|
338
|
+
this.shareAudioTrack.stop();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
335
341
|
}, {
|
|
336
342
|
key: "replaceScreenShare",
|
|
337
343
|
value: function replaceScreenShare(id, type, withAudio, bounds) {
|
|
@@ -346,7 +352,7 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
346
352
|
var _observer = {
|
|
347
353
|
onScreenCaptureStateUpdated: function () {
|
|
348
354
|
var _onScreenCaptureStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(sourceId, state) {
|
|
349
|
-
var _this2$screenTrack
|
|
355
|
+
var _this2$screenTrack;
|
|
350
356
|
return _regenerator["default"].wrap(function (_context2) {
|
|
351
357
|
while (1) switch (_context2.prev = _context2.next) {
|
|
352
358
|
case 0:
|
|
@@ -360,21 +366,13 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
360
366
|
return _this2.startShareScreen(id, type, withAudio, true);
|
|
361
367
|
case 1:
|
|
362
368
|
_this2._sharedScreenShareSharedDataSource.setCurrentShareIdInfos(id, type, bounds);
|
|
363
|
-
if (_this2.currentShareStreamId) {
|
|
364
|
-
|
|
365
|
-
bindConfig = {
|
|
369
|
+
if (_this2.currentShareStreamId && _this2._streamControl) {
|
|
370
|
+
_this2._streamControl.bindLocalStreams([{
|
|
366
371
|
streamId: _this2.currentShareStreamId,
|
|
372
|
+
audioSourceId: _this2.loopbackAudioSourceId,
|
|
367
373
|
videoSourceId: id
|
|
368
|
-
};
|
|
369
|
-
if (loopbackAudioSourceId) {
|
|
370
|
-
bindConfig.audioSourceId = loopbackAudioSourceId;
|
|
371
|
-
} else {
|
|
372
|
-
_this2.logger.warn('cannot get loopbackAudioSourceId before calling bindLocalStreams');
|
|
373
|
-
}
|
|
374
|
-
_this2._streamControl.bindLocalStreams([bindConfig]);
|
|
374
|
+
}]);
|
|
375
375
|
_this2.toggleScreenshareWithAudio(shareWithAudio);
|
|
376
|
-
} else {
|
|
377
|
-
_this2.logger.error('currentShareStreamId is not set');
|
|
378
376
|
}
|
|
379
377
|
case 2:
|
|
380
378
|
case "end":
|
|
@@ -396,7 +394,8 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
396
394
|
}, {
|
|
397
395
|
key: "_handleRemoteVideoStatsUpdated",
|
|
398
396
|
value: function _handleRemoteVideoStatsUpdated(roomId, streamId, videoStats) {
|
|
399
|
-
var
|
|
397
|
+
var _this$_streamControl3;
|
|
398
|
+
var stream = (_this$_streamControl3 = this._streamControl) === null || _this$_streamControl3 === void 0 ? void 0 : _this$_streamControl3.getStreamByStreamId(streamId);
|
|
400
399
|
if ((stream === null || stream === void 0 ? void 0 : stream.videoSourceType) === _fcrCore.FcrVideoSourceType.SCREEN) {
|
|
401
400
|
var _videoStats$dimension = videoStats.dimensions,
|
|
402
401
|
width = _videoStats$dimension.width,
|
|
@@ -419,6 +418,14 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
419
418
|
get: function get() {
|
|
420
419
|
return this._sharedScreenShareSharedDataSource.shareWithAudioTrack;
|
|
421
420
|
}
|
|
421
|
+
}, {
|
|
422
|
+
key: "loopbackAudioSourceId",
|
|
423
|
+
get: function get() {
|
|
424
|
+
if (!this._sharedScreenShareSharedDataSource.loopbackAudioSourceId) {
|
|
425
|
+
throw new Error('loopbackAudioSourceId is null');
|
|
426
|
+
}
|
|
427
|
+
return this._sharedScreenShareSharedDataSource.loopbackAudioSourceId;
|
|
428
|
+
}
|
|
422
429
|
}, {
|
|
423
430
|
key: "currentShareId",
|
|
424
431
|
get: function get() {
|
|
@@ -448,35 +455,32 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
448
455
|
key: "createScreenShareWithSelectionId",
|
|
449
456
|
value: function () {
|
|
450
457
|
var _createScreenShareWithSelectionId = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(videoSourceId, bounds) {
|
|
451
|
-
var
|
|
458
|
+
var audioSourceId, _this$_sharingControl, targetEncoderConfig, shareWithAudio, streamId;
|
|
452
459
|
return _regenerator["default"].wrap(function (_context3) {
|
|
453
460
|
while (1) switch (_context3.prev = _context3.next) {
|
|
454
461
|
case 0:
|
|
455
462
|
this.logger.info("screen-share-provider: createScreenShareWithSelectionId: ".concat(videoSourceId, ", annotation-use-bounds-width: ").concat(bounds.width, ", annotation-use-bounds-height: ").concat(bounds.height));
|
|
456
|
-
|
|
463
|
+
audioSourceId = this.loopbackAudioSourceId;
|
|
464
|
+
if (!(this._sharingControl && this._streamControl)) {
|
|
465
|
+
_context3.next = 2;
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
457
468
|
targetEncoderConfig = this.screenShareScenarioType === _imports.FcrScreenScenarioType.CLEARITY ? _config.clearityEncoderConfig : _config.smoothEncoderConfig;
|
|
458
469
|
this._streamControl.setScreenScenario(this.screenShareScenarioType);
|
|
459
470
|
shareWithAudio = this._sharedScreenShareSharedDataSource.shareWithAudio;
|
|
460
|
-
streamCreateConfig = {
|
|
461
|
-
streamType: shareWithAudio ? _type.FcrStreamType.BOTH : _type.FcrStreamType.VIDEO,
|
|
462
|
-
videoSourceId: videoSourceId
|
|
463
|
-
};
|
|
464
|
-
if (loopbackAudioSourceId) {
|
|
465
|
-
streamCreateConfig.audioSourceId = loopbackAudioSourceId;
|
|
466
|
-
} else {
|
|
467
|
-
this.logger.warn('cannot get loopbackAudioSourceId before calling startScreenSharing');
|
|
468
|
-
}
|
|
469
471
|
_context3.next = 1;
|
|
470
|
-
return this._sharingControl.startScreenSharing(
|
|
472
|
+
return (_this$_sharingControl = this._sharingControl) === null || _this$_sharingControl === void 0 ? void 0 : _this$_sharingControl.startScreenSharing({
|
|
473
|
+
streamType: shareWithAudio ? _type.FcrStreamType.BOTH : _type.FcrStreamType.VIDEO,
|
|
474
|
+
videoSourceId: videoSourceId,
|
|
475
|
+
audioSourceId: audioSourceId
|
|
476
|
+
}, bounds);
|
|
471
477
|
case 1:
|
|
472
478
|
streamId = _context3.sent;
|
|
473
|
-
if (shareWithAudio) {
|
|
474
|
-
this._updateShareAudioPrivilege(streamId, true);
|
|
475
|
-
this._handleShareStartWithAudio();
|
|
476
|
-
}
|
|
477
479
|
this._streamControl.setVideoEncoderConfig(streamId, targetEncoderConfig, _type.FcrVideoStreamType.HIGH_STREAM);
|
|
478
480
|
return _context3.abrupt("return", Promise.resolve(streamId));
|
|
479
481
|
case 2:
|
|
482
|
+
return _context3.abrupt("return", Promise.reject());
|
|
483
|
+
case 3:
|
|
480
484
|
case "end":
|
|
481
485
|
return _context3.stop();
|
|
482
486
|
}
|
|
@@ -598,8 +602,8 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
598
602
|
}, {
|
|
599
603
|
key: "_syncScreenShareStreamInfos",
|
|
600
604
|
value: function _syncScreenShareStreamInfos() {
|
|
601
|
-
var _this$_roomProvider$
|
|
602
|
-
var streams = (_this$_roomProvider$
|
|
605
|
+
var _this$_roomProvider$c3, _streams$find;
|
|
606
|
+
var streams = (_this$_roomProvider$c3 = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c3 === void 0 ? void 0 : _this$_roomProvider$c3.getStreamControl().getStreamList();
|
|
603
607
|
var isSharingScreen = streams === null || streams === void 0 ? void 0 : streams.some(function (stream) {
|
|
604
608
|
return stream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN;
|
|
605
609
|
});
|
|
@@ -633,10 +637,11 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
633
637
|
}, {
|
|
634
638
|
key: "release",
|
|
635
639
|
value: function release() {
|
|
640
|
+
var _this$_streamControl4;
|
|
636
641
|
this.logger.info('[screen-share-provider] in release');
|
|
637
642
|
this._hasStop = false;
|
|
638
643
|
this.stop();
|
|
639
|
-
this._streamControl.removeObserver(this._streamObserver);
|
|
644
|
+
(_this$_streamControl4 = this._streamControl) === null || _this$_streamControl4 === void 0 || _this$_streamControl4.removeObserver(this._streamObserver);
|
|
640
645
|
this._removeEventListeners();
|
|
641
646
|
}
|
|
642
647
|
}, {
|
|
@@ -693,13 +698,15 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
693
698
|
case 7:
|
|
694
699
|
_context4.prev = 7;
|
|
695
700
|
_t2 = _context4["catch"](1);
|
|
696
|
-
|
|
697
|
-
throw _t2;
|
|
701
|
+
return _context4.abrupt("return", null);
|
|
698
702
|
case 8:
|
|
703
|
+
_context4.prev = 8;
|
|
704
|
+
return _context4.abrupt("return", this.screenTrack);
|
|
705
|
+
case 9:
|
|
699
706
|
case "end":
|
|
700
707
|
return _context4.stop();
|
|
701
708
|
}
|
|
702
|
-
}, _callee4, this, [[1, 7]]);
|
|
709
|
+
}, _callee4, this, [[1, 7, 8, 9]]);
|
|
703
710
|
}));
|
|
704
711
|
function startShareScreen(_x7, _x8, _x9, _x0) {
|
|
705
712
|
return _startShareScreen.apply(this, arguments);
|
|
@@ -726,34 +733,10 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
726
733
|
this._stopScreenTrack();
|
|
727
734
|
this._cleanShareWithAudioDataSource();
|
|
728
735
|
}
|
|
729
|
-
}, {
|
|
730
|
-
key: "_updateShareAudioPrivilege",
|
|
731
|
-
value: function _updateShareAudioPrivilege(streamId, withAudio) {
|
|
732
|
-
this._streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, streamId, {
|
|
733
|
-
audioPrivilege: withAudio ? _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
|
|
734
|
-
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
735
|
-
}));
|
|
736
|
-
}
|
|
737
|
-
}, {
|
|
738
|
-
key: "_handleShareStopWithAudio",
|
|
739
|
-
value: function _handleShareStopWithAudio() {
|
|
740
|
-
if (!this.shareAudioTrack) {
|
|
741
|
-
return;
|
|
742
|
-
}
|
|
743
|
-
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE)) {
|
|
744
|
-
this.logger.info('[screen-share-provider][handleShareStopWithAudio] shareAudioTrack.stop');
|
|
745
|
-
this.shareAudioTrack.stop();
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
736
|
}, {
|
|
749
737
|
key: "_handleShareStartWithAudio",
|
|
750
738
|
value: function _handleShareStartWithAudio() {
|
|
751
|
-
var
|
|
752
|
-
if (!loopbackAudioSourceId) {
|
|
753
|
-
this.logger.error('cannot get loopbackAudioSourceId before calling getLoopbackTrack');
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
var shareAudioTrack = this._deviceProvider.getLoopbackTrack(loopbackAudioSourceId);
|
|
739
|
+
var shareAudioTrack = this._deviceProvider.getLoopbackTrack(this.loopbackAudioSourceId);
|
|
757
740
|
this._sharedScreenShareSharedDataSource.setShareWithAudioTrack(shareAudioTrack);
|
|
758
741
|
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE) && this.shareAudioTrack && this.shareAudioTrack.getState() === _fcrCore.FcrMediaSourceState.CLOSE) {
|
|
759
742
|
this.shareAudioTrack.start();
|
|
@@ -764,15 +747,16 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
764
747
|
value: function toggleScreenshareWithAudio(withAudio) {
|
|
765
748
|
this._sharedScreenShareSharedDataSource.setShareWithAudio(withAudio);
|
|
766
749
|
this.logger.info("[screen-share-provider] current-share with audio: ".concat(withAudio));
|
|
767
|
-
if (this.currentShareStreamId) {
|
|
768
|
-
this.
|
|
750
|
+
if (this.currentShareStreamId && this._streamControl) {
|
|
751
|
+
this._streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this.currentShareStreamId, {
|
|
752
|
+
audioPrivilege: withAudio ? _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
|
|
753
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
754
|
+
}));
|
|
769
755
|
if (withAudio) {
|
|
770
756
|
this._handleShareStartWithAudio();
|
|
771
757
|
} else {
|
|
772
758
|
this._handleShareStopWithAudio();
|
|
773
759
|
}
|
|
774
|
-
} else {
|
|
775
|
-
this.logger.error('currentShareStreamId is not set');
|
|
776
760
|
}
|
|
777
761
|
}
|
|
778
762
|
}, {
|
|
@@ -818,9 +802,10 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
818
802
|
key: "removeScreenStream",
|
|
819
803
|
value: function removeScreenStream() {
|
|
820
804
|
try {
|
|
805
|
+
var _this$_streamControl5;
|
|
821
806
|
this.logger.info('screen-share-provider: remove screen streams');
|
|
822
|
-
this._streamControl.removeScreenStream();
|
|
823
|
-
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId(
|
|
807
|
+
(_this$_streamControl5 = this._streamControl) === null || _this$_streamControl5 === void 0 || _this$_streamControl5.removeScreenStream();
|
|
808
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId('');
|
|
824
809
|
return true;
|
|
825
810
|
} catch (error) {
|
|
826
811
|
this.logger.error('removeScreenStream error', error);
|
|
@@ -845,6 +830,6 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
845
830
|
}]);
|
|
846
831
|
}();
|
|
847
832
|
_FcrUIScreenShareProviderImpl = FcrUIScreenShareProviderImpl;
|
|
848
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIScreenShareProviderImpl, [[_decorator.bound, 2, "setSharingInReplace"], [_zoomOutDecs, 18, "zoomOut"], [_zoomInDecs, 18, "zoomIn"], [_fullContainerDecs, 18, "fullContainer"], [_mobx.computed, 3, "isAspectRatioPreserved"], [_setOriginScalcDecs, 18, "setOriginScalc"], [_decorator.bound, 2, "stop"], [_decorator.bound, 2, "bootstrap"], [_decorator.bound, 2, "_handleWebScreenCaptureStateUpdated"], [_handleScreenCaptureStateUpdatedDecs, 18, "_handleScreenCaptureStateUpdated"], [_replaceScreenShareDecs, 18, "replaceScreenShare"], [_handleRemoteVideoStatsUpdatedDecs, 18, "_handleRemoteVideoStatsUpdated"], [_decorator.bound, 2, "_syncShareStreamState"], [_handleStreamUpdateDecs, 18, "_handleStreamUpdate"], [_decorator.bound, 2, "startRenderSharePreview"], [_decorator.bound, 2, "stopRenderSharePreview"], [_syncScreenShareStreamInfosDecs, 18, "_syncScreenShareStreamInfos"], [_releaseDecs, 18, "release"], [_startShareScreenDecs, 18, "startShareScreen"], [_decorator.bound, 2, "stopShareScreen"], [_decorator.bound, 2, "stopShareScreenByExitRoom"], [
|
|
833
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIScreenShareProviderImpl, [[_decorator.bound, 2, "setSharingInReplace"], [_zoomOutDecs, 18, "zoomOut"], [_zoomInDecs, 18, "zoomIn"], [_fullContainerDecs, 18, "fullContainer"], [_mobx.computed, 3, "isAspectRatioPreserved"], [_setOriginScalcDecs, 18, "setOriginScalc"], [_decorator.bound, 2, "stop"], [_decorator.bound, 2, "bootstrap"], [_decorator.bound, 2, "_handleWebScreenCaptureStateUpdated"], [_handleScreenCaptureStateUpdatedDecs, 18, "_handleScreenCaptureStateUpdated"], [_handleShareStopWithAudioDecs, 18, "_handleShareStopWithAudio"], [_replaceScreenShareDecs, 18, "replaceScreenShare"], [_handleRemoteVideoStatsUpdatedDecs, 18, "_handleRemoteVideoStatsUpdated"], [_decorator.bound, 2, "_syncShareStreamState"], [_handleStreamUpdateDecs, 18, "_handleStreamUpdate"], [_decorator.bound, 2, "startRenderSharePreview"], [_decorator.bound, 2, "stopRenderSharePreview"], [_syncScreenShareStreamInfosDecs, 18, "_syncScreenShareStreamInfos"], [_releaseDecs, 18, "release"], [_startShareScreenDecs, 18, "startShareScreen"], [_decorator.bound, 2, "stopShareScreen"], [_decorator.bound, 2, "stopShareScreenByExitRoom"], [_handleShareStartWithAudioDecs, 18, "_handleShareStartWithAudio"], [_decorator.bound, 2, "toggleScreenshareWithAudio"], [_decorator.bound, 2, "_getExcludeWindows"], [_decorator.bound, 2, "removeScreenStream"], [_decorator.bound, 2, "_stopScreenTrack"], [_decorator.bound, 2, "_cleanShareWithAudioDataSource"]], []).e, 1);
|
|
849
834
|
_initProto = _applyDecs$e[0];
|
|
850
835
|
(0, _base.registerDependency)('screenShareProvider');
|
|
@@ -89,9 +89,6 @@ var FcrUISharingProviderImpl = exports.FcrUISharingProviderImpl = /*#__PURE__*/f
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
onWhiteboardStarted: function onWhiteboardStarted(ownerId, operatorUser) {
|
|
92
|
-
if (_this.whiteboardState === _type.FcrWhiteboardState.START) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
92
|
_this.whiteboardOwnerId = ownerId;
|
|
96
93
|
_this.whiteboardState = _type.FcrWhiteboardState.START;
|
|
97
94
|
var owner = _this._userControl.getUser(ownerId);
|
|
@@ -105,13 +102,9 @@ var FcrUISharingProviderImpl = exports.FcrUISharingProviderImpl = /*#__PURE__*/f
|
|
|
105
102
|
_this.logger.info("[sharing-provider]: onWhiteboardStarted ".concat(ownerId, ", ").concat(JSON.stringify(operatorUser), ", backgroundColor: ").concat(_this._whiteboardProvider.backgroundColor));
|
|
106
103
|
},
|
|
107
104
|
onWhiteboardEnded: function onWhiteboardEnded(reason, operatorUser) {
|
|
108
|
-
if (_this.whiteboardState === _type.FcrWhiteboardState.END) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
105
|
_this._sharedWhiteboardDataSource.setJoinSuccess(false);
|
|
112
106
|
_this._sharedWhiteboardDataSource.setShowLoading(true);
|
|
113
107
|
_this._sharedWhiteboardDataSource.inActive();
|
|
114
|
-
_this._sharedWhiteboardDataSource.setSharingUser(undefined);
|
|
115
108
|
_this.logger.info("[sharing-provider]: onWhiteboardEnded, joinSuccess: ".concat(_this._sharedWhiteboardDataSource.joinSuccess));
|
|
116
109
|
_this.whiteboardState = _type.FcrWhiteboardState.END;
|
|
117
110
|
}
|
|
@@ -78,7 +78,6 @@ var FcrUIWhiteboardProviderImpl = exports.FcrUIWhiteboardProviderImpl = /*#__PUR
|
|
|
78
78
|
},
|
|
79
79
|
onInactive: function onInactive(reason, operatorUser) {
|
|
80
80
|
_this.logger.info("[whiteboard-provider]: onInactive ".concat(reason, ", ").concat(JSON.stringify(operatorUser)));
|
|
81
|
-
_this._sharedWhiteboardDataSource.setSharingUser(undefined);
|
|
82
81
|
},
|
|
83
82
|
onConnectionStateUpdated: function onConnectionStateUpdated(state) {
|
|
84
83
|
_this.logger.info("[whiteboard-provider]: onConnectionStateUpdated ".concat(state));
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CurrentShareBounds } from '../modules/control-bar/types';
|
|
2
1
|
export interface FcrUISharedConfirmDataSource {
|
|
3
2
|
get position(): {
|
|
4
3
|
x: number;
|
|
@@ -12,33 +11,15 @@ export interface FcrUISharedConfirmDataSource {
|
|
|
12
11
|
x: number;
|
|
13
12
|
y: number;
|
|
14
13
|
}): void;
|
|
15
|
-
setWindowBounds(key: string, window: CurrentShareBounds): void;
|
|
16
|
-
removeWindowBounds(key: string): void;
|
|
17
|
-
addObserver(observer: FcrMousePositionObserver): void;
|
|
18
|
-
removeObserver(observer: FcrMousePositionObserver): void;
|
|
19
14
|
}
|
|
20
|
-
export type FcrMousePositionObserver = {
|
|
21
|
-
onMouseOver(key: string): void;
|
|
22
|
-
onMouseOut(key: string): void;
|
|
23
|
-
};
|
|
24
15
|
export declare class FcrUISharedConfirmDataSourceImpl implements FcrUISharedConfirmDataSource {
|
|
25
16
|
protected logger: import("agora-foundation/lib/logger").Logger;
|
|
26
|
-
private _observable;
|
|
27
17
|
accessor position: {
|
|
28
18
|
x: number;
|
|
29
19
|
y: number;
|
|
30
20
|
};
|
|
31
|
-
accessor windows: Map<string, CurrentShareBounds>;
|
|
32
|
-
accessor mouseOverState: Set<unknown>;
|
|
33
|
-
constructor();
|
|
34
21
|
setPosition(position: {
|
|
35
22
|
x: number;
|
|
36
23
|
y: number;
|
|
37
24
|
}): void;
|
|
38
|
-
setWindowBounds(key: string, window: CurrentShareBounds): void;
|
|
39
|
-
removeWindowBounds(key: string): void;
|
|
40
|
-
addObserver(observer: FcrMousePositionObserver): void;
|
|
41
|
-
removeObserver(observer: FcrMousePositionObserver): void;
|
|
42
|
-
release(): void;
|
|
43
|
-
private _addLogObserver;
|
|
44
25
|
}
|