fcr-ui-scene 3.6.1 → 3.6.3
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/creator.d.ts +6 -0
- package/lib/creator.js +125 -24
- package/lib/electron/app.js +5 -4
- package/lib/electron/bootstrap-dev.js +3 -0
- package/lib/electron/bootstrap-sdk.js +4 -0
- package/lib/electron/injections.d.ts +5 -0
- package/lib/electron/injections.js +36 -8
- package/lib/electron/ipc/ipc.d.ts +1 -0
- package/lib/electron/ipc/ipc.js +4 -0
- package/lib/electron/main.js +16 -8
- package/lib/electron/plugins/screenshot.js +4 -2
- package/lib/electron/preload.js +7 -2
- package/lib/electron/window.js +4 -6
- package/lib/fragments/annotation/index.d.ts +11 -0
- package/lib/fragments/annotation/index.js +121 -0
- package/lib/fragments/annotation/libs.d.ts +55 -0
- package/lib/fragments/annotation/libs.js +93 -0
- package/lib/fragments/annotation/store.d.ts +30 -0
- package/lib/fragments/annotation/store.js +565 -0
- package/lib/fragments/annotation/view.d.ts +3 -0
- package/lib/fragments/annotation/view.js +31 -0
- package/lib/fragments/base.d.ts +10 -0
- package/lib/fragments/base.js +44 -0
- package/lib/modules/action-bar/components/screen-share/submenu.js +7 -6
- package/lib/modules/action-bar/index.css +11 -0
- package/lib/modules/action-bar/index.d.ts +2 -0
- package/lib/modules/action-bar/index.js +1 -0
- package/lib/modules/action-bar/store.d.ts +7 -9
- package/lib/modules/action-bar/store.js +49 -90
- package/lib/modules/annotation/board-cursor.css +76 -0
- package/lib/modules/annotation/components/control-bar/index.css +48 -0
- package/lib/modules/annotation/components/control-bar/index.d.ts +3 -0
- package/lib/modules/annotation/components/control-bar/index.js +141 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.d.ts +3 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/color-panel/index.js +46 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/index.d.ts +1 -0
- package/lib/modules/annotation/components/toolbar/components/color-tool/index.js +52 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.d.ts +3 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/index.js +61 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +12 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.js +65 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.d.ts +1 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/index.js +68 -0
- package/lib/modules/annotation/components/toolbar/components/item/item.d.ts +18 -0
- package/lib/modules/annotation/components/toolbar/components/item/item.js +116 -0
- package/lib/modules/annotation/components/toolbar/components/item/style.css +43 -0
- package/lib/modules/annotation/components/toolbar/components/panel/index.d.ts +5 -0
- package/lib/modules/annotation/components/toolbar/components/panel/index.js +22 -0
- package/lib/modules/annotation/components/toolbar/components/panel/style.css +24 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/index.d.ts +1 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/index.js +58 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.d.ts +3 -0
- package/lib/modules/annotation/components/toolbar/components/pen-tool/pen-panel/index.js +34 -0
- package/lib/modules/annotation/components/toolbar/components/tips/index.d.ts +2 -0
- package/lib/modules/annotation/components/toolbar/components/tips/index.js +25 -0
- package/lib/modules/annotation/components/toolbar/components/tips/style.css +19 -0
- package/lib/modules/annotation/components/toolbar/index.d.ts +0 -0
- package/lib/modules/annotation/components/toolbar/index.js +1 -0
- package/lib/modules/annotation/components/toolbar/store.d.ts +40 -0
- package/lib/modules/annotation/components/toolbar/store.js +279 -0
- package/lib/modules/annotation/components/toolbar/style.css +55 -0
- package/lib/modules/annotation/components/toolbar/view.d.ts +2 -0
- package/lib/modules/annotation/components/toolbar/view.js +120 -0
- package/lib/modules/annotation/index.d.ts +38 -0
- package/lib/modules/annotation/index.js +169 -0
- package/lib/modules/annotation/store.d.ts +93 -0
- package/lib/modules/annotation/store.js +673 -0
- package/lib/modules/annotation/style.css +26 -0
- package/lib/modules/annotation/view.d.ts +3 -0
- package/lib/modules/annotation/view.js +49 -0
- package/lib/modules/chat/view.js +112 -100
- package/lib/modules/components/annotation-menu/index.d.ts +7 -0
- package/lib/modules/components/annotation-menu/index.js +119 -0
- package/lib/modules/components/leave-meeting/components/assign-host.js +26 -23
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.d.ts +0 -1
- package/lib/modules/components/member-window/components/member-actions/components/audio-control.js +10 -4
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.d.ts +4 -2
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +10 -6
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.d.ts +0 -2
- package/lib/modules/components/member-window/components/member-actions/components/icon-status.js +3 -4
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +0 -3
- package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +6 -32
- package/lib/modules/components/member-window/components/member-actions/components/share-status.js +11 -3
- package/lib/modules/components/member-window/components/member-actions/components/user-info.d.ts +0 -1
- package/lib/modules/components/member-window/components/member-actions/components/user-info.js +7 -10
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.d.ts +0 -1
- package/lib/modules/components/member-window/components/member-actions/components/user-tag.js +0 -2
- package/lib/modules/components/member-window/components/member-actions/index.js +1 -32
- package/lib/modules/components/member-window/components/member-actions/store.d.ts +38 -1
- package/lib/modules/components/member-window/components/member-actions/store.js +130 -23
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.d.ts +2 -1
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player.js +6 -1
- package/lib/modules/components/member-window/components/video-player/index.d.ts +1 -0
- package/lib/modules/components/member-window/index.css +37 -0
- package/lib/modules/components/member-window/index.d.ts +1 -1
- package/lib/modules/components/member-window/index.js +8 -5
- package/lib/modules/components/member-window/types.d.ts +2 -0
- package/lib/modules/components/security-menu/index.js +7 -6
- package/lib/modules/control-bar/components/annotation-button/index.d.ts +1 -0
- package/lib/modules/control-bar/components/annotation-button/index.js +59 -0
- package/lib/modules/control-bar/index.d.ts +6 -6
- package/lib/modules/control-bar/index.js +5 -34
- package/lib/modules/control-bar/store.d.ts +27 -13
- package/lib/modules/control-bar/store.js +121 -126
- package/lib/modules/control-bar/view.js +50 -4
- package/lib/modules/dialog/components/annotation-tool/index.d.ts +4 -0
- package/lib/modules/dialog/components/annotation-tool/index.js +53 -0
- package/lib/modules/dialog/components/chat/index.js +1 -1
- package/lib/modules/dialog/components/control-bar/index.d.ts +0 -2
- package/lib/modules/dialog/components/control-bar/index.js +1 -3
- package/lib/modules/dialog/components/host-area-container/index.d.ts +12 -0
- package/lib/modules/dialog/components/host-area-container/index.js +214 -0
- package/lib/modules/dialog/components/participant/index.js +1 -1
- package/lib/modules/dialog/components/system-preference/index.js +1 -1
- package/lib/modules/dialog/components/video-window/index.js +1 -0
- package/lib/modules/dialog/hooks/use-popover-watcher.d.ts +14 -0
- package/lib/modules/dialog/hooks/use-popover-watcher.js +112 -0
- package/lib/modules/dialog/hooks/useElectron.d.ts +1 -0
- package/lib/modules/dialog/hooks/useElectron.js +13 -3
- package/lib/modules/dialog/index.d.ts +2 -3
- package/lib/modules/dialog/index.js +3 -26
- package/lib/modules/dialog/store.d.ts +14 -9
- package/lib/modules/dialog/store.js +56 -50
- package/lib/modules/event-confirm/components/window/index.d.ts +7 -0
- package/lib/modules/event-confirm/components/window/index.js +188 -0
- package/lib/modules/event-confirm/index.d.ts +4 -4
- package/lib/modules/event-confirm/index.js +6 -4
- package/lib/modules/event-confirm/store.d.ts +4 -5
- package/lib/modules/event-confirm/store.js +35 -26
- package/lib/modules/event-confirm/view.js +23 -171
- package/lib/modules/event-sound/index.js +1 -1
- package/lib/modules/layout/components/CommonVideoRenderer.js +33 -16
- package/lib/modules/layout/index.d.ts +4 -0
- package/lib/modules/layout/index.js +2 -0
- package/lib/modules/layout/store.d.ts +14 -2
- package/lib/modules/layout/store.js +77 -45
- package/lib/modules/layout/type.d.ts +7 -0
- package/lib/modules/participant/index.d.ts +2 -0
- package/lib/modules/participant/index.js +2 -1
- package/lib/modules/participant/store.d.ts +5 -2
- package/lib/modules/participant/store.js +73 -25
- package/lib/modules/setting/audio-settings/audio-settings.js +3 -14
- package/lib/modules/setting/index.d.ts +2 -0
- package/lib/modules/setting/index.js +3 -3
- package/lib/modules/setting/store.d.ts +8 -10
- package/lib/modules/setting/store.js +22 -20
- package/lib/modules/share-screen/components/selection/index.js +18 -42
- package/lib/modules/share-screen/index.d.ts +6 -2
- package/lib/modules/share-screen/index.js +4 -2
- package/lib/modules/share-screen/store.d.ts +41 -46
- package/lib/modules/share-screen/store.js +297 -718
- package/lib/modules/share-screen/view.js +2 -2
- package/lib/modules/state-bar/assets/fcr_grid_big.svg +1 -1
- package/lib/modules/state-bar/assets/fcr_listontop_big.svg +1 -1
- package/lib/modules/state-bar/index.css +8 -6
- package/lib/modules/state-bar/index.d.ts +4 -0
- package/lib/modules/state-bar/index.js +3 -1
- package/lib/modules/state-bar/layout-config.d.ts +1 -0
- package/lib/modules/state-bar/layout-config.js +15 -5
- package/lib/modules/state-bar/store.d.ts +9 -1
- package/lib/modules/state-bar/store.js +17 -2
- package/lib/modules/state-bar/view.js +9 -4
- package/lib/modules/video-window/components/members/index.js +2 -1
- package/lib/modules/waiting-room-layout/store.js +1 -1
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +5 -1
- package/lib/modules/whiteboard/components/control-bar/store.js +10 -1
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +16 -5
- package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +67 -12
- package/lib/modules/whiteboard/components/toolbar/components/expansion/index.js +22 -2
- package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -14
- package/lib/modules/whiteboard/components/toolbar/components/item/index.js +3 -2
- package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +1 -1
- package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +58 -16
- package/lib/modules/whiteboard/components/toolbar/components/screen-capture-picker.js +15 -4
- package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +45 -2
- package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
- package/lib/modules/whiteboard/components/toolbar/hooks/index.js +235 -7
- package/lib/modules/whiteboard/components/toolbar/index.d.ts +1 -1
- package/lib/modules/whiteboard/components/toolbar/index.js +1 -1
- package/lib/modules/whiteboard/components/toolbar/store.d.ts +13 -2
- package/lib/modules/whiteboard/components/toolbar/store.js +74 -24
- package/lib/modules/whiteboard/components/toolbar/{ style.css → style.css} +1 -0
- package/lib/modules/whiteboard/index.d.ts +2 -0
- package/lib/modules/whiteboard/index.js +22 -21
- package/lib/modules/whiteboard/style.css +0 -4
- package/lib/modules/whiteboard/view.js +8 -2
- package/lib/plugins/browser-runtime-plugin.js +10 -1
- package/lib/providers/annotation-provider.d.ts +128 -0
- package/lib/providers/annotation-provider.js +421 -0
- package/lib/providers/device-provider.d.ts +3 -3
- package/lib/providers/device-provider.js +8 -6
- package/lib/providers/event-provider.d.ts +3 -3
- package/lib/providers/interpreter-provider.d.ts +1 -0
- package/lib/providers/interpreter-provider.js +182 -154
- package/lib/providers/privilege-provider.d.ts +35 -6
- package/lib/providers/privilege-provider.js +105 -49
- package/lib/providers/renderer-provider.js +3 -7
- package/lib/providers/room-provider.d.ts +13 -1
- package/lib/providers/room-provider.js +21 -7
- package/lib/providers/screen-share-provider.d.ts +131 -34
- package/lib/providers/screen-share-provider.js +554 -173
- package/lib/providers/sharing-provider.d.ts +37 -0
- package/lib/{shared-data-source/screen-share-data-source.js → providers/sharing-provider.js} +102 -39
- package/lib/providers/user-setting-storage-provider.d.ts +20 -0
- package/lib/providers/user-setting-storage-provider.js +74 -0
- package/lib/runtime.d.ts +6 -1
- package/lib/scenes/main-scene.d.ts +7 -2
- package/lib/scenes/main-scene.js +55 -27
- package/lib/scenes/waiting-scene.d.ts +6 -0
- package/lib/scenes/waiting-scene.js +15 -5
- package/lib/shared-data-source/config.d.ts +1 -5
- package/lib/shared-data-source/config.js +11 -81
- package/lib/shared-data-source/member-data.d.ts +21 -5
- package/lib/shared-data-source/member-data.js +69 -17
- package/lib/shared-data-source/screen-share-data.d.ts +274 -0
- package/lib/shared-data-source/screen-share-data.js +390 -0
- package/lib/shared-data-source/security-data.d.ts +4 -1
- package/lib/shared-data-source/security-data.js +5 -2
- package/lib/shared-data-source/setting.d.ts +13 -13
- package/lib/shared-data-source/setting.js +16 -10
- package/lib/shared-data-source/video-window.d.ts +2 -1
- package/lib/shared-data-source/video-window.js +56 -36
- package/lib/translations/enUS.d.ts +8 -0
- package/lib/translations/enUS.js +9 -1
- package/lib/translations/zhCN.d.ts +8 -0
- package/lib/translations/zhCN.js +11 -3
- package/lib/type.d.ts +55 -1
- package/lib/ui-manager.d.ts +3 -2
- package/lib/ui-manager.js +6 -4
- package/lib/ui-scene.js +70 -50
- package/lib/utilities/constant.d.ts +10 -2
- package/lib/utilities/constant.js +8 -0
- package/lib/utilities/logger.d.ts +4 -0
- package/lib/utilities/logger.js +8 -1
- package/lib/utilities/renderer-event.d.ts +3 -0
- package/lib/utilities/renderer-event.js +14 -1
- package/lib/utilities/screen.js +2 -1
- package/lib/utilities/setting-config-storage.d.ts +5 -6
- package/lib/utilities/setting-config-storage.js +33 -39
- package/lib/utilities/tools.d.ts +19 -1
- package/lib/utilities/tools.js +51 -4
- package/package.json +9 -7
- package/public/assets/cursors/fcr_whiteboard_input.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_pen.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_-straightline.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_arrow.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_circle.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_rectangle.ico +0 -0
- package/public/assets/cursors/fcr_whiteboard_shape_triangle.ico +0 -0
- package/public/assets/fcr_chat_reddot.svg +3 -3
- package/public/assets/fcr_grid_big.svg +1 -1
- package/public/assets/fcr_leave2.svg +14 -14
- package/public/assets/fcr_listontop_big.svg +1 -1
- package/public/assets/step-gradient.svg +1 -1
- package/public/fragment.html +10 -0
- package/public/index.html +3 -1
- package/lib/shared-data-source/screen-share-data-source.d.ts +0 -37
|
@@ -6,7 +6,7 @@ require("core-js/modules/es.symbol.to-primitive.js");
|
|
|
6
6
|
require("core-js/modules/es.error.cause.js");
|
|
7
7
|
require("core-js/modules/es.error.to-string.js");
|
|
8
8
|
require("core-js/modules/es.array.is-array.js");
|
|
9
|
-
require("core-js/modules/es.array.
|
|
9
|
+
require("core-js/modules/es.array.iterator.js");
|
|
10
10
|
require("core-js/modules/es.date.to-primitive.js");
|
|
11
11
|
require("core-js/modules/es.function.bind.js");
|
|
12
12
|
require("core-js/modules/es.function.name.js");
|
|
@@ -15,6 +15,7 @@ require("core-js/modules/es.number.constructor.js");
|
|
|
15
15
|
require("core-js/modules/es.object.create.js");
|
|
16
16
|
require("core-js/modules/es.object.define-property.js");
|
|
17
17
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
18
|
+
require("core-js/modules/es.string.iterator.js");
|
|
18
19
|
require("core-js/modules/esnext.function.metadata.js");
|
|
19
20
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
20
21
|
require("core-js/modules/esnext.map.emplace.js");
|
|
@@ -31,6 +32,7 @@ require("core-js/modules/esnext.map.reduce.js");
|
|
|
31
32
|
require("core-js/modules/esnext.map.some.js");
|
|
32
33
|
require("core-js/modules/esnext.map.update.js");
|
|
33
34
|
require("core-js/modules/esnext.symbol.metadata.js");
|
|
35
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
34
36
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
35
37
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
36
38
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -39,166 +41,450 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
39
41
|
exports.FcrUIScreenShareProviderImpl = void 0;
|
|
40
42
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
41
43
|
require("core-js/modules/es.array.concat.js");
|
|
42
|
-
require("core-js/modules/es.array.filter.js");
|
|
43
44
|
require("core-js/modules/es.array.find.js");
|
|
44
45
|
require("core-js/modules/es.array.includes.js");
|
|
45
|
-
require("core-js/modules/es.array.
|
|
46
|
+
require("core-js/modules/es.array.push.js");
|
|
46
47
|
require("core-js/modules/es.array.some.js");
|
|
48
|
+
require("core-js/modules/es.date.to-json.js");
|
|
49
|
+
require("core-js/modules/es.json.stringify.js");
|
|
47
50
|
require("core-js/modules/es.object.to-string.js");
|
|
48
|
-
require("core-js/modules/es.
|
|
49
|
-
require("core-js/modules/es.
|
|
50
|
-
require("core-js/modules/esnext.async-iterator.filter.js");
|
|
51
|
+
require("core-js/modules/es.promise.js");
|
|
52
|
+
require("core-js/modules/es.string.includes.js");
|
|
51
53
|
require("core-js/modules/esnext.async-iterator.find.js");
|
|
52
54
|
require("core-js/modules/esnext.async-iterator.some.js");
|
|
53
55
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
54
|
-
require("core-js/modules/esnext.iterator.filter.js");
|
|
55
56
|
require("core-js/modules/esnext.iterator.find.js");
|
|
56
57
|
require("core-js/modules/esnext.iterator.some.js");
|
|
57
|
-
require("core-js/modules/esnext.weak-map.delete-all.js");
|
|
58
|
-
require("core-js/modules/esnext.weak-map.emplace.js");
|
|
59
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
60
58
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
61
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
62
59
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
63
60
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
64
61
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
65
62
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
66
63
|
var _observable = require("agora-foundation/lib/utilities/observable");
|
|
67
|
-
var _screenCapturePermission = require("../utilities/screen-capture-permission");
|
|
68
64
|
var _fcrCore = require("fcr-core");
|
|
69
65
|
var _base = require("../base");
|
|
70
|
-
var _constant = require("../utilities/constant");
|
|
71
66
|
var _mobx = require("mobx");
|
|
72
|
-
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
73
|
-
var _type = require("agora-ui-foundation/lib/components/icon/type");
|
|
74
67
|
var _env = require("agora-foundation/lib/utilities/env");
|
|
75
68
|
var _logger = require("../utilities/logger");
|
|
76
|
-
var
|
|
69
|
+
var _type = require("agora-rte-sdk/lib/type");
|
|
77
70
|
var _decorator = require("agora-foundation/lib/decorator");
|
|
78
71
|
var _types = require("fcr-core/lib/room-control/whiteboard-control/types");
|
|
72
|
+
var _rendererEvent = require("../utilities/renderer-event");
|
|
73
|
+
var _tools = require("../utilities/tools");
|
|
74
|
+
var _imports = require("fcr-core/lib/imports");
|
|
75
|
+
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
76
|
+
var _constant = require("../utilities/constant");
|
|
77
|
+
var _lodash = require("lodash");
|
|
79
78
|
var _FcrUIScreenShareProviderImpl;
|
|
80
|
-
var _initProto,
|
|
81
|
-
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
82
|
-
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
83
|
-
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
84
|
-
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
|
85
|
-
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
|
79
|
+
var _initProto, _handleScreenCaptureStateUpdatedDecs, _handleShareStopWithAudioDecs, _replaceScreenShareDecs, _handleStreamUpdateDecs, _handleStreamPublicDecs, _releaseDecs, _startShareScreenDecs, _handleShareStartWithAudioDecs, _ref;
|
|
86
80
|
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)]; } }; }
|
|
87
81
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
88
82
|
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); }
|
|
89
83
|
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; }
|
|
90
84
|
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; }
|
|
91
|
-
|
|
92
|
-
var _B = /*#__PURE__*/new WeakMap();
|
|
93
|
-
var _C = /*#__PURE__*/new WeakMap();
|
|
94
|
-
var _D = /*#__PURE__*/new WeakMap();
|
|
95
|
-
var _E = /*#__PURE__*/new WeakMap();
|
|
96
|
-
var _F = /*#__PURE__*/new WeakMap();
|
|
97
|
-
_ref = (_handleStreamRemovedDecs = [_mobx.action, _mobx.action.bound], _handleStreamPublicDecs = [_mobx.action, _mobx.action.bound], _releaseDecs = [_mobx.action, _mobx.action.bound], _startShareScreenDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
85
|
+
_ref = (_handleScreenCaptureStateUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleShareStopWithAudioDecs = [_mobx.action, _mobx.action.bound], _replaceScreenShareDecs = [_mobx.action, _mobx.action.bound], _handleStreamUpdateDecs = [_mobx.action, _mobx.action.bound], _handleStreamPublicDecs = [_mobx.action, _mobx.action.bound], _releaseDecs = [_mobx.action, _mobx.action.bound], _startShareScreenDecs = [_mobx.action, _mobx.action.bound], _handleShareStartWithAudioDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
98
86
|
var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__PURE__*/function () {
|
|
99
|
-
function FcrUIScreenShareProviderImpl(_deviceProvider,
|
|
100
|
-
var _this
|
|
87
|
+
function FcrUIScreenShareProviderImpl(_deviceProvider, _eventProvider, _roomProvider, _sharingProvider, _sharedScreenShareSharedDataSource, _sharedMemberDataSource) {
|
|
88
|
+
var _this = this,
|
|
89
|
+
_this$_roomProvider$c,
|
|
90
|
+
_this$_roomProvider$c2,
|
|
91
|
+
_this$_streamControl;
|
|
101
92
|
(0, _classCallCheck2["default"])(this, FcrUIScreenShareProviderImpl);
|
|
102
93
|
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
103
94
|
prefix: 'FcrUIScreenShareProviderImpl'
|
|
104
95
|
})));
|
|
96
|
+
(0, _defineProperty2["default"])(this, "shareLock", false);
|
|
97
|
+
(0, _defineProperty2["default"])(this, "_previewDom", null);
|
|
105
98
|
(0, _defineProperty2["default"])(this, "_observable", new _observable.AgoraObservable());
|
|
106
|
-
(0, _defineProperty2["default"])(this, "
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
(0, _defineProperty2["default"])(this, "_streamObserver", {
|
|
100
|
+
onStreamsAdded: function onStreamsAdded(_, events) {
|
|
101
|
+
return _this._handleStreamUpdate('add', events);
|
|
102
|
+
},
|
|
103
|
+
onStreamsRemoved: function onStreamsRemoved(_, events) {
|
|
104
|
+
return _this._handleStreamUpdate('remove', events);
|
|
105
|
+
},
|
|
106
|
+
onStreamsUpdated: function onStreamsUpdated(_, events) {
|
|
107
|
+
return _this._handleStreamUpdate('update', events);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
(0, _defineProperty2["default"])(this, "_screenCaptureObserver", {
|
|
111
|
+
onScreenCaptureStateUpdated: (0, _env.isElectron)() ? this._handleScreenCaptureStateUpdated : this._handleWebScreenCaptureStateUpdated
|
|
111
112
|
});
|
|
112
|
-
_classPrivateFieldInitSpec(this, _A, _init_applicationCaptureSources(this, []));
|
|
113
|
-
_classPrivateFieldInitSpec(this, _B, _init_screenCaptureSources(this, []));
|
|
114
|
-
_classPrivateFieldInitSpec(this, _C, _init_shareSelectionDialogId(this, ''));
|
|
115
|
-
_classPrivateFieldInitSpec(this, _D, _init_isSharingScreen(this, false));
|
|
116
|
-
_classPrivateFieldInitSpec(this, _E, _init_isSeizeStream(this, false));
|
|
117
|
-
_classPrivateFieldInitSpec(this, _F, _init_screenSharingOwner(this));
|
|
118
113
|
this._deviceProvider = _deviceProvider;
|
|
119
|
-
this.
|
|
114
|
+
this._eventProvider = _eventProvider;
|
|
120
115
|
this._roomProvider = _roomProvider;
|
|
121
|
-
|
|
116
|
+
this._sharingProvider = _sharingProvider;
|
|
117
|
+
this._sharedScreenShareSharedDataSource = _sharedScreenShareSharedDataSource;
|
|
118
|
+
this._sharedMemberDataSource = _sharedMemberDataSource;
|
|
119
|
+
this._sharingControl = (_this$_roomProvider$c = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c === void 0 ? void 0 : _this$_roomProvider$c.getSharingControl();
|
|
120
|
+
this._streamControl = (_this$_roomProvider$c2 = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c2 === void 0 ? void 0 : _this$_roomProvider$c2.getStreamControl();
|
|
121
|
+
(_this$_streamControl = this._streamControl) === null || _this$_streamControl === void 0 || _this$_streamControl.addObserver(this._streamObserver);
|
|
122
|
+
this._addEventListeners();
|
|
123
|
+
this._syncShareStreamState();
|
|
122
124
|
}
|
|
123
125
|
return (0, _createClass2["default"])(FcrUIScreenShareProviderImpl, [{
|
|
124
|
-
key: "
|
|
126
|
+
key: "shareWithAudio",
|
|
125
127
|
get: function get() {
|
|
126
|
-
return
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
return this._sharedScreenShareSharedDataSource.shareWithAudio;
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "audioSourceId",
|
|
132
|
+
get: function get() {
|
|
133
|
+
return this._deviceProvider.speakerId;
|
|
134
|
+
}
|
|
135
|
+
}, {
|
|
136
|
+
key: "getCurrentScreenSharingOwner",
|
|
137
|
+
value: function getCurrentScreenSharingOwner() {
|
|
138
|
+
var _this$_streamControl2;
|
|
139
|
+
var allStreams = (_this$_streamControl2 = this._streamControl) === null || _this$_streamControl2 === void 0 ? void 0 : _this$_streamControl2.getStreamList();
|
|
140
|
+
var screenShareStream = allStreams === null || allStreams === void 0 ? void 0 : allStreams.find(function (stream) {
|
|
141
|
+
return stream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN && (stream.streamType === _imports.AgoraRteMediaStreamType.BOTH || stream.streamType === _imports.AgoraRteMediaStreamType.VIDEO);
|
|
142
|
+
});
|
|
143
|
+
if (screenShareStream) {
|
|
144
|
+
return screenShareStream.owner;
|
|
145
|
+
} else {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}, {
|
|
150
|
+
key: "stop",
|
|
151
|
+
value: function stop() {
|
|
152
|
+
this._observable.notifyObservers('onScreenCaptureStopped');
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "bootstrap",
|
|
156
|
+
value: function bootstrap() {
|
|
157
|
+
this._observable.notifyObservers('onScreenCaptureStarted');
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "_handleWebScreenCaptureStateUpdated",
|
|
161
|
+
value: function () {
|
|
162
|
+
var _handleWebScreenCaptureStateUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(sourceId, state) {
|
|
163
|
+
var streamId, _this$screenTrack;
|
|
164
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
165
|
+
while (1) switch (_context.prev = _context.next) {
|
|
166
|
+
case 0:
|
|
167
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingState(state);
|
|
168
|
+
if (!(state === _fcrCore.FcrMediaSourceState.OPEN)) {
|
|
169
|
+
_context.next = 7;
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
this.setShareLock(true);
|
|
173
|
+
_context.next = 5;
|
|
174
|
+
return this.createScreenShareWithSelectionId(this.currentShareId, this.currentSelectionBounds);
|
|
175
|
+
case 5:
|
|
176
|
+
streamId = _context.sent;
|
|
177
|
+
if (streamId) {
|
|
178
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId(streamId);
|
|
179
|
+
}
|
|
180
|
+
case 7:
|
|
181
|
+
if (state === _fcrCore.FcrMediaSourceState.CLOSE) {
|
|
182
|
+
this.setShareLock(false);
|
|
183
|
+
(_this$screenTrack = this.screenTrack) === null || _this$screenTrack === void 0 || _this$screenTrack.removeObserver(this._screenCaptureObserver);
|
|
184
|
+
this.isReplaceScreen ? this._screenTrackStop() : this.stop();
|
|
185
|
+
this.logger.info("[Annotation][web]: _handleScreenCaptureStateUpdated: CLOSE, set replaceScreen to: ".concat(this.isReplaceScreen));
|
|
186
|
+
}
|
|
187
|
+
if (state === _fcrCore.FcrMediaSourceState.ERROR) {
|
|
188
|
+
this.setShareLock(false);
|
|
189
|
+
this._setIsReplaceScreen(false);
|
|
190
|
+
}
|
|
191
|
+
case 9:
|
|
192
|
+
case "end":
|
|
193
|
+
return _context.stop();
|
|
194
|
+
}
|
|
195
|
+
}, _callee, this);
|
|
196
|
+
}));
|
|
197
|
+
function _handleWebScreenCaptureStateUpdated(_x, _x2) {
|
|
198
|
+
return _handleWebScreenCaptureStateUpdated2.apply(this, arguments);
|
|
199
|
+
}
|
|
200
|
+
return _handleWebScreenCaptureStateUpdated;
|
|
201
|
+
}()
|
|
202
|
+
}, {
|
|
203
|
+
key: "_handleScreenCaptureStateUpdated",
|
|
204
|
+
value: function _handleScreenCaptureStateUpdated(sourceId, state) {
|
|
205
|
+
this.logger.info("[handleScreenCaptureStateUpdated]: ".concat(sourceId, " ==== ").concat(state));
|
|
206
|
+
if (state === _fcrCore.FcrMediaSourceState.CLOSE) {
|
|
207
|
+
var _this$screenTrack2;
|
|
208
|
+
this.stopRenderSharePreview(this.screenTrack);
|
|
209
|
+
(_this$screenTrack2 = this.screenTrack) === null || _this$screenTrack2 === void 0 || _this$screenTrack2.removeObserver(this._screenCaptureObserver);
|
|
210
|
+
this.isReplaceScreen ? this._screenTrackStop() : this.stop();
|
|
211
|
+
// this._setIsReplaceScreen(false); // 如果是替换的逻辑,暂时不把是否是替换屏幕的值设置为false,改为在结束屏幕共享时重置
|
|
212
|
+
this.logger.info("[Annotation][electron]: _handleScreenCaptureStateUpdated: CLOSE, set replaceScreen to: ".concat(this.isReplaceScreen));
|
|
213
|
+
}
|
|
214
|
+
if (state === _fcrCore.FcrMediaSourceState.ERROR) {
|
|
215
|
+
this.stop();
|
|
216
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingState(_fcrCore.FcrMediaSourceState.CLOSE);
|
|
217
|
+
this._setIsReplaceScreen(false);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingState(state);
|
|
130
221
|
}
|
|
131
222
|
}, {
|
|
132
|
-
key: "
|
|
223
|
+
key: "_handleShareStopWithAudio",
|
|
224
|
+
value: function _handleShareStopWithAudio() {
|
|
225
|
+
if (!this.shareAudioTrack) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE)) {
|
|
229
|
+
this.shareAudioTrack.stop();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}, {
|
|
233
|
+
key: "replaceScreenShare",
|
|
234
|
+
value: function replaceScreenShare(id, type, withAudio, bounds) {
|
|
235
|
+
var _this2 = this;
|
|
236
|
+
this.logger.info('screen-share-provider: replaceScreenShare start');
|
|
237
|
+
var shareWithAudio = (0, _lodash.isBoolean)(withAudio) ? withAudio : this._sharedScreenShareSharedDataSource.shareWithAudio;
|
|
238
|
+
this.toggleScreenshareWithAudio(shareWithAudio);
|
|
239
|
+
this._sharedScreenShareSharedDataSource.setIsReplaceScreen(true);
|
|
240
|
+
if (this.screenTrack) {
|
|
241
|
+
var _this$screenTrack3;
|
|
242
|
+
var _observer = {
|
|
243
|
+
onScreenCaptureStateUpdated: function () {
|
|
244
|
+
var _onScreenCaptureStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(sourceId, state) {
|
|
245
|
+
var _this2$screenTrack;
|
|
246
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
247
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
248
|
+
case 0:
|
|
249
|
+
if (!(state === _fcrCore.FcrMediaSourceState.CLOSE)) {
|
|
250
|
+
_context2.next = 7;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
_this2._observable.notifyObservers('onScreenShareReplaceBegin', id, type, bounds);
|
|
254
|
+
(_this2$screenTrack = _this2.screenTrack) === null || _this2$screenTrack === void 0 || _this2$screenTrack.removeObserver(_observer);
|
|
255
|
+
_context2.next = 5;
|
|
256
|
+
return _this2.startShareScreen(id, type, withAudio, true);
|
|
257
|
+
case 5:
|
|
258
|
+
_this2._sharedScreenShareSharedDataSource.setCurrentShareIdInfos(id, type, bounds);
|
|
259
|
+
if (_this2.currentShareStreamId && _this2._streamControl) {
|
|
260
|
+
_this2._streamControl.bindLocalStreams([{
|
|
261
|
+
streamId: _this2.currentShareStreamId,
|
|
262
|
+
audioSourceId: _this2.loopbackAudioSourceId,
|
|
263
|
+
videoSourceId: id
|
|
264
|
+
}]);
|
|
265
|
+
}
|
|
266
|
+
case 7:
|
|
267
|
+
case "end":
|
|
268
|
+
return _context2.stop();
|
|
269
|
+
}
|
|
270
|
+
}, _callee2);
|
|
271
|
+
}));
|
|
272
|
+
function onScreenCaptureStateUpdated(_x3, _x4) {
|
|
273
|
+
return _onScreenCaptureStateUpdated.apply(this, arguments);
|
|
274
|
+
}
|
|
275
|
+
return onScreenCaptureStateUpdated;
|
|
276
|
+
}()
|
|
277
|
+
};
|
|
278
|
+
(_this$screenTrack3 = this.screenTrack) === null || _this$screenTrack3 === void 0 || _this$screenTrack3.addObserver(_observer);
|
|
279
|
+
this._screenTrackStop();
|
|
280
|
+
this.stopRenderSharePreview(this.screenTrack);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
key: "_setIsReplaceScreen",
|
|
285
|
+
value: function _setIsReplaceScreen(isReplace) {
|
|
286
|
+
this._sharedScreenShareSharedDataSource.setIsReplaceScreen(isReplace);
|
|
287
|
+
}
|
|
288
|
+
}, {
|
|
289
|
+
key: "isReplaceScreen",
|
|
133
290
|
get: function get() {
|
|
134
|
-
return
|
|
135
|
-
},
|
|
136
|
-
set: function set(v) {
|
|
137
|
-
_classPrivateFieldSet(_B, this, v);
|
|
291
|
+
return this._sharedScreenShareSharedDataSource.isReplaceScreen;
|
|
138
292
|
}
|
|
139
293
|
}, {
|
|
140
|
-
key: "
|
|
294
|
+
key: "localUserId",
|
|
141
295
|
get: function get() {
|
|
142
|
-
return
|
|
143
|
-
},
|
|
144
|
-
set: function set(v) {
|
|
145
|
-
_classPrivateFieldSet(_C, this, v);
|
|
296
|
+
return this._sharedMemberDataSource.localUser.userId;
|
|
146
297
|
}
|
|
147
298
|
}, {
|
|
148
|
-
key: "
|
|
299
|
+
key: "shareAudioTrack",
|
|
149
300
|
get: function get() {
|
|
150
|
-
return
|
|
151
|
-
},
|
|
152
|
-
set: function set(v) {
|
|
153
|
-
_classPrivateFieldSet(_D, this, v);
|
|
301
|
+
return this._sharedScreenShareSharedDataSource.shareWithAudioTrack;
|
|
154
302
|
}
|
|
155
303
|
}, {
|
|
156
|
-
key: "
|
|
304
|
+
key: "loopbackAudioSourceId",
|
|
157
305
|
get: function get() {
|
|
158
|
-
return
|
|
159
|
-
},
|
|
160
|
-
set: function set(v) {
|
|
161
|
-
_classPrivateFieldSet(_E, this, v);
|
|
306
|
+
return this._sharedScreenShareSharedDataSource.loopbackAudioSourceId;
|
|
162
307
|
}
|
|
163
308
|
}, {
|
|
164
|
-
key: "
|
|
309
|
+
key: "currentShareId",
|
|
165
310
|
get: function get() {
|
|
166
|
-
return
|
|
167
|
-
},
|
|
168
|
-
set: function set(v) {
|
|
169
|
-
_classPrivateFieldSet(_F, this, v);
|
|
311
|
+
return this._sharedScreenShareSharedDataSource.currentShareId;
|
|
170
312
|
}
|
|
171
313
|
}, {
|
|
172
|
-
key: "
|
|
173
|
-
|
|
174
|
-
this.
|
|
314
|
+
key: "screenTrack",
|
|
315
|
+
get: function get() {
|
|
316
|
+
return this._sharedScreenShareSharedDataSource.screenTrack;
|
|
175
317
|
}
|
|
176
318
|
}, {
|
|
177
|
-
key: "
|
|
178
|
-
|
|
179
|
-
this.
|
|
319
|
+
key: "currentShareStreamId",
|
|
320
|
+
get: function get() {
|
|
321
|
+
return this._sharedScreenShareSharedDataSource.currentShareStreamId;
|
|
322
|
+
}
|
|
323
|
+
}, {
|
|
324
|
+
key: "currentSelectionBounds",
|
|
325
|
+
get: function get() {
|
|
326
|
+
return this._sharedScreenShareSharedDataSource.currentSelectionBounds;
|
|
327
|
+
}
|
|
328
|
+
}, {
|
|
329
|
+
key: "setShareLock",
|
|
330
|
+
value: function setShareLock(lock) {
|
|
331
|
+
this.shareLock = lock;
|
|
180
332
|
}
|
|
181
333
|
}, {
|
|
182
|
-
key: "
|
|
183
|
-
value: function
|
|
334
|
+
key: "createScreenShareWithSelectionId",
|
|
335
|
+
value: function () {
|
|
336
|
+
var _createScreenShareWithSelectionId = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(videoSourceId, bounds) {
|
|
337
|
+
var audioSourceId, _this$_sharingControl, streamId;
|
|
338
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
339
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
340
|
+
case 0:
|
|
341
|
+
this.logger.info('screen-share-provider: createScreenShareWithSelectionId: ', videoSourceId);
|
|
342
|
+
audioSourceId = this.loopbackAudioSourceId;
|
|
343
|
+
if (!this._sharingControl) {
|
|
344
|
+
_context3.next = 9;
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
_context3.next = 5;
|
|
348
|
+
return (_this$_sharingControl = this._sharingControl) === null || _this$_sharingControl === void 0 ? void 0 : _this$_sharingControl.startScreenSharing({
|
|
349
|
+
streamType: _imports.AgoraRteMediaStreamType.BOTH,
|
|
350
|
+
videoSourceId: videoSourceId,
|
|
351
|
+
audioSourceId: audioSourceId
|
|
352
|
+
}, bounds);
|
|
353
|
+
case 5:
|
|
354
|
+
streamId = _context3.sent;
|
|
355
|
+
return _context3.abrupt("return", Promise.resolve(streamId));
|
|
356
|
+
case 9:
|
|
357
|
+
return _context3.abrupt("return", Promise.reject());
|
|
358
|
+
case 10:
|
|
359
|
+
case "end":
|
|
360
|
+
return _context3.stop();
|
|
361
|
+
}
|
|
362
|
+
}, _callee3, this);
|
|
363
|
+
}));
|
|
364
|
+
function createScreenShareWithSelectionId(_x5, _x6) {
|
|
365
|
+
return _createScreenShareWithSelectionId.apply(this, arguments);
|
|
366
|
+
}
|
|
367
|
+
return createScreenShareWithSelectionId;
|
|
368
|
+
}()
|
|
369
|
+
}, {
|
|
370
|
+
key: "_isStoppedFor",
|
|
371
|
+
value: function _isStoppedFor(events, reason) {
|
|
372
|
+
var _this3 = this;
|
|
373
|
+
return events && events.find(function (event) {
|
|
374
|
+
var _event$cause;
|
|
375
|
+
return ((_event$cause = event.cause) === null || _event$cause === void 0 || (_event$cause = _event$cause.data) === null || _event$cause === void 0 ? void 0 : _event$cause.reason) === reason && event.modifiedStream.owner.userId === _this3.localUserId;
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}, {
|
|
379
|
+
key: "_addEventListeners",
|
|
380
|
+
value: function _addEventListeners() {
|
|
381
|
+
window.addEventListener('online', this._syncShareStreamState);
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
key: "_removeEventListeners",
|
|
385
|
+
value: function _removeEventListeners() {
|
|
386
|
+
window.removeEventListener('online', this._syncShareStreamState);
|
|
387
|
+
}
|
|
388
|
+
}, {
|
|
389
|
+
key: "_syncShareStreamState",
|
|
390
|
+
value: function _syncShareStreamState() {
|
|
391
|
+
var _this$_streamControl3,
|
|
392
|
+
_this4 = this;
|
|
393
|
+
var currentShareStreamId = this.currentShareStreamId || ((_this$_streamControl3 = this._streamControl) === null || _this$_streamControl3 === void 0 || (_this$_streamControl3 = _this$_streamControl3.getStreamList().find(function (stream) {
|
|
394
|
+
return stream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN && stream.owner.userId === _this4.localUserId;
|
|
395
|
+
})) === null || _this$_streamControl3 === void 0 ? void 0 : _this$_streamControl3.streamId);
|
|
396
|
+
if (this._sharedScreenShareSharedDataSource.screenSharingState !== _fcrCore.FcrMediaSourceState.OPEN && currentShareStreamId) {
|
|
397
|
+
this.stop();
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}, {
|
|
401
|
+
key: "_handleStreamUpdate",
|
|
402
|
+
value: function _handleStreamUpdate(process, events) {
|
|
403
|
+
var _this5 = this;
|
|
184
404
|
this._handleStreamPublic();
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
405
|
+
var isClosedByOther = this._isStoppedFor(events, _types.FcrBoardInactiveReason.CLOSE);
|
|
406
|
+
var isSeizedByOther = this._isStoppedFor(events, _types.FcrBoardInactiveReason.SEIZE);
|
|
407
|
+
var operatorUser = (isSeizedByOther === null || isSeizedByOther === void 0 ? void 0 : isSeizedByOther.operatorUser) || (isClosedByOther === null || isClosedByOther === void 0 ? void 0 : isClosedByOther.operatorUser);
|
|
408
|
+
var ownerUser = (isSeizedByOther === null || isSeizedByOther === void 0 ? void 0 : isSeizedByOther.modifiedStream.owner) || (isClosedByOther === null || isClosedByOther === void 0 ? void 0 : isClosedByOther.modifiedStream.owner);
|
|
409
|
+
var selfOperated = (operatorUser === null || operatorUser === void 0 ? void 0 : operatorUser.userId) === this.localUserId;
|
|
410
|
+
var isMyOwnShare = this.localUserId === (ownerUser === null || ownerUser === void 0 ? void 0 : ownerUser.userId);
|
|
411
|
+
if ((isSeizedByOther || isClosedByOther) && !selfOperated) {
|
|
412
|
+
this._screenTrackStop();
|
|
413
|
+
}
|
|
414
|
+
isClosedByOther && !selfOperated && isMyOwnShare && this._eventProvider.sendEvent(_constant.FcrUIAction.SHOW_TOAST, {
|
|
415
|
+
type: 'info',
|
|
416
|
+
message: (0, _i18n.transI18n)('fmt_share_tips_sharingdisabled')
|
|
188
417
|
});
|
|
418
|
+
switch (process) {
|
|
419
|
+
case 'add':
|
|
420
|
+
// 抢占流添加时,不设置抢占流状态,因为抢占发生时,会触发 remove 事件,此时判断 reason===seize 的结果设置抢占流状态
|
|
421
|
+
// const newsStreamsHaveScreenShare = events.some(
|
|
422
|
+
// (event) => event.modifiedStream.videoSourceType === AgoraRteVideoSourceType.SCREEN,
|
|
423
|
+
// );
|
|
424
|
+
// const isSeizeStreamAdd =
|
|
425
|
+
// newsStreamsHaveScreenShare && this._sharedScreenShareSharedDataSource.isSharingScreen;
|
|
426
|
+
// this._sharedScreenShareSharedDataSource.setIsSeizeStream(isSeizeStreamAdd);
|
|
427
|
+
break;
|
|
428
|
+
case 'remove':
|
|
429
|
+
var isSeizeStreamRemove = events.some(function (event) {
|
|
430
|
+
var _event$cause2, _event$operatorUser;
|
|
431
|
+
return event.modifiedStream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN && ((_event$cause2 = event.cause) === null || _event$cause2 === void 0 || (_event$cause2 = _event$cause2.data) === null || _event$cause2 === void 0 ? void 0 : _event$cause2.reason) === _types.FcrBoardInactiveReason.SEIZE && ((_event$operatorUser = event.operatorUser) === null || _event$operatorUser === void 0 ? void 0 : _event$operatorUser.userId) !== event.modifiedStream.owner.userId;
|
|
432
|
+
});
|
|
433
|
+
this._sharedScreenShareSharedDataSource.setIsSeizeStream(isSeizeStreamRemove);
|
|
434
|
+
this.logger.info('stream update remove', isSeizeStreamRemove);
|
|
435
|
+
if (events.some(function (event) {
|
|
436
|
+
return event.modifiedStream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN && event.modifiedStream.owner.userId === _this5.localUserId;
|
|
437
|
+
})) {
|
|
438
|
+
if (!(0, _env.isElectron)() && this.isReplaceScreen) {
|
|
439
|
+
// web下的替换流不需要停止采集
|
|
440
|
+
this._setIsReplaceScreen(false);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
this.logger.info('screen-share-provider: current user stream remove');
|
|
444
|
+
this._screenTrackStop();
|
|
445
|
+
}
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}, {
|
|
450
|
+
key: "startRenderSharePreview",
|
|
451
|
+
value: function startRenderSharePreview(dom, targetScreenTrack) {
|
|
452
|
+
this._previewDom = dom;
|
|
453
|
+
var screenTrack = targetScreenTrack !== null && targetScreenTrack !== void 0 ? targetScreenTrack : this.screenTrack;
|
|
454
|
+
if (dom) {
|
|
455
|
+
screenTrack === null || screenTrack === void 0 || screenTrack.startPreview({
|
|
456
|
+
renderMode: 1,
|
|
457
|
+
isMirror: false
|
|
458
|
+
}, dom);
|
|
459
|
+
} else {
|
|
460
|
+
screenTrack === null || screenTrack === void 0 || screenTrack.stopPreview(dom);
|
|
461
|
+
this._previewDom = null;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}, {
|
|
465
|
+
key: "stopRenderSharePreview",
|
|
466
|
+
value: function stopRenderSharePreview(targetScreenTrack) {
|
|
467
|
+
var screenTrack = targetScreenTrack !== null && targetScreenTrack !== void 0 ? targetScreenTrack : this.screenTrack;
|
|
468
|
+
this._previewDom && (screenTrack === null || screenTrack === void 0 ? void 0 : screenTrack.stopPreview(this._previewDom));
|
|
189
469
|
}
|
|
190
470
|
}, {
|
|
191
471
|
key: "_handleStreamPublic",
|
|
192
472
|
value: function _handleStreamPublic() {
|
|
193
|
-
var _this$_roomProvider$
|
|
194
|
-
var streams = (_this$_roomProvider$
|
|
473
|
+
var _this$_roomProvider$c3, _streams$find;
|
|
474
|
+
var streams = (_this$_roomProvider$c3 = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c3 === void 0 ? void 0 : _this$_roomProvider$c3.getStreamControl().getStreamList();
|
|
195
475
|
var isSharingScreen = streams === null || streams === void 0 ? void 0 : streams.some(function (stream) {
|
|
196
|
-
return stream.videoSourceType ===
|
|
476
|
+
return stream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN;
|
|
197
477
|
});
|
|
198
|
-
this.
|
|
199
|
-
|
|
200
|
-
return stream.videoSourceType ===
|
|
478
|
+
this._sharedScreenShareSharedDataSource.setIsSharingScreen(!!isSharingScreen);
|
|
479
|
+
var screenSharingOwner = streams === null || streams === void 0 || (_streams$find = streams.find(function (stream) {
|
|
480
|
+
return stream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN;
|
|
201
481
|
})) === null || _streams$find === void 0 ? void 0 : _streams$find.owner;
|
|
482
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingOwner(screenSharingOwner);
|
|
483
|
+
}
|
|
484
|
+
}, {
|
|
485
|
+
key: "setScreenTrack",
|
|
486
|
+
value: function setScreenTrack(screenTrack) {
|
|
487
|
+
this._sharedScreenShareSharedDataSource.setScreenTrack(screenTrack);
|
|
202
488
|
}
|
|
203
489
|
}, {
|
|
204
490
|
key: "addObserver",
|
|
@@ -208,120 +494,215 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
208
494
|
}, {
|
|
209
495
|
key: "removeObserver",
|
|
210
496
|
value: function removeObserver(observer) {
|
|
211
|
-
this._observable.removeObserver;
|
|
497
|
+
this._observable.removeObserver(observer);
|
|
212
498
|
}
|
|
213
499
|
}, {
|
|
214
500
|
key: "startShareWhiteboard",
|
|
215
501
|
value: function startShareWhiteboard() {
|
|
216
|
-
var _this$
|
|
217
|
-
(_this$
|
|
502
|
+
var _this$_sharingProvide;
|
|
503
|
+
(_this$_sharingProvide = this._sharingProvider) === null || _this$_sharingProvide === void 0 || _this$_sharingProvide.startWhiteboard();
|
|
218
504
|
}
|
|
219
505
|
}, {
|
|
220
506
|
key: "stopShareWhiteboard",
|
|
221
507
|
value: function stopShareWhiteboard() {
|
|
222
|
-
var _this$
|
|
223
|
-
(_this$
|
|
508
|
+
var _this$_sharingProvide2;
|
|
509
|
+
(_this$_sharingProvide2 = this._sharingProvider) === null || _this$_sharingProvide2 === void 0 || _this$_sharingProvide2.stop();
|
|
224
510
|
}
|
|
225
511
|
}, {
|
|
226
512
|
key: "release",
|
|
227
513
|
value: function release() {
|
|
228
|
-
var _this$
|
|
229
|
-
(_this$
|
|
514
|
+
var _this$_streamControl4;
|
|
515
|
+
(_this$_streamControl4 = this._streamControl) === null || _this$_streamControl4 === void 0 || _this$_streamControl4.removeObserver(this._streamObserver);
|
|
516
|
+
this._removeEventListeners();
|
|
230
517
|
}
|
|
231
518
|
}, {
|
|
232
519
|
key: "startShareScreen",
|
|
233
|
-
value: function
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
520
|
+
value: function () {
|
|
521
|
+
var _startShareScreen = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(id, type, withAudio, isReplace) {
|
|
522
|
+
var _this$screenTrack4, _this$screenTrack5, streamId, screenTrack;
|
|
523
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
524
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
525
|
+
case 0:
|
|
526
|
+
this.setShareLock(true);
|
|
527
|
+
_context4.prev = 1;
|
|
528
|
+
this.logger.info('screen-share-provider: enter startShareScreen');
|
|
529
|
+
if (!((0, _env.isElectron)() && !isReplace)) {
|
|
530
|
+
_context4.next = 8;
|
|
531
|
+
break;
|
|
532
|
+
}
|
|
533
|
+
_context4.next = 6;
|
|
534
|
+
return this.createScreenShareWithSelectionId(id, this.currentSelectionBounds);
|
|
535
|
+
case 6:
|
|
536
|
+
streamId = _context4.sent;
|
|
537
|
+
if (streamId) {
|
|
538
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId(streamId);
|
|
539
|
+
}
|
|
540
|
+
case 8:
|
|
541
|
+
this._sharedScreenShareSharedDataSource.setShareWithAudio(withAudio);
|
|
542
|
+
this.toggleScreenshareWithAudio(withAudio);
|
|
543
|
+
screenTrack = this._deviceProvider.getScreenTrack(id);
|
|
544
|
+
this.setScreenTrack(screenTrack);
|
|
545
|
+
this.logger.info('screen-share-provider: start share screen with track start');
|
|
546
|
+
(_this$screenTrack4 = this.screenTrack) === null || _this$screenTrack4 === void 0 || _this$screenTrack4.addObserver(this._screenCaptureObserver);
|
|
547
|
+
_context4.t0 = (_this$screenTrack5 = this.screenTrack) === null || _this$screenTrack5 === void 0;
|
|
548
|
+
if (_context4.t0) {
|
|
549
|
+
_context4.next = 29;
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
_context4.t1 = _this$screenTrack5;
|
|
553
|
+
_context4.t2 = type;
|
|
554
|
+
_context4.t3 = withAudio;
|
|
555
|
+
if (!(0, _env.isElectron)()) {
|
|
556
|
+
_context4.next = 25;
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
_context4.next = 22;
|
|
560
|
+
return this._getExcludeWindows();
|
|
561
|
+
case 22:
|
|
562
|
+
_context4.t4 = _context4.sent;
|
|
563
|
+
_context4.next = 26;
|
|
564
|
+
break;
|
|
565
|
+
case 25:
|
|
566
|
+
_context4.t4 = undefined;
|
|
567
|
+
case 26:
|
|
568
|
+
_context4.t5 = _context4.t4;
|
|
569
|
+
_context4.t6 = {
|
|
570
|
+
withAudio: _context4.t3,
|
|
571
|
+
excludeWindows: _context4.t5
|
|
572
|
+
};
|
|
573
|
+
_context4.t1.start.call(_context4.t1, _context4.t2, _context4.t6);
|
|
574
|
+
case 29:
|
|
575
|
+
return _context4.abrupt("return", Promise.resolve(this.screenTrack));
|
|
576
|
+
case 32:
|
|
577
|
+
_context4.prev = 32;
|
|
578
|
+
_context4.t7 = _context4["catch"](1);
|
|
579
|
+
return _context4.abrupt("return", Promise.reject(_context4.t7));
|
|
580
|
+
case 35:
|
|
581
|
+
case "end":
|
|
582
|
+
return _context4.stop();
|
|
583
|
+
}
|
|
584
|
+
}, _callee4, this, [[1, 32]]);
|
|
585
|
+
}));
|
|
586
|
+
function startShareScreen(_x7, _x8, _x9, _x10) {
|
|
587
|
+
return _startShareScreen.apply(this, arguments);
|
|
254
588
|
}
|
|
255
|
-
|
|
589
|
+
return startShareScreen;
|
|
590
|
+
}()
|
|
256
591
|
}, {
|
|
257
592
|
key: "stopShareScreen",
|
|
258
|
-
value: function stopShareScreen() {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
593
|
+
value: function stopShareScreen(targetScreenTrack) {
|
|
594
|
+
this.logger.info('screen-share-provider: stopShareScreen');
|
|
595
|
+
var screenTrack = targetScreenTrack !== null && targetScreenTrack !== void 0 ? targetScreenTrack : this.screenTrack;
|
|
596
|
+
this.stopRenderSharePreview(screenTrack);
|
|
597
|
+
this.removeScreenStream();
|
|
598
|
+
this._screenTrackStop();
|
|
599
|
+
}
|
|
600
|
+
}, {
|
|
601
|
+
key: "_handleShareStartWithAudio",
|
|
602
|
+
value: function _handleShareStartWithAudio() {
|
|
603
|
+
var shareAudioTrack = this._deviceProvider.getLoopbackTrack(this.loopbackAudioSourceId);
|
|
604
|
+
this._sharedScreenShareSharedDataSource.setShareWithAudioTrack(shareAudioTrack);
|
|
605
|
+
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE) && this.shareAudioTrack && this.shareAudioTrack.getState() === _fcrCore.FcrMediaSourceState.CLOSE) {
|
|
606
|
+
this.shareAudioTrack.start();
|
|
263
607
|
}
|
|
264
608
|
}
|
|
265
609
|
}, {
|
|
266
|
-
key: "
|
|
267
|
-
value: function
|
|
268
|
-
|
|
269
|
-
this.
|
|
270
|
-
|
|
610
|
+
key: "toggleScreenshareWithAudio",
|
|
611
|
+
value: function toggleScreenshareWithAudio(withAudio) {
|
|
612
|
+
this._sharedScreenShareSharedDataSource.setShareWithAudio(withAudio);
|
|
613
|
+
if (this.currentShareStreamId && this._streamControl) {
|
|
614
|
+
this._streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this.currentShareStreamId, {
|
|
615
|
+
audioPrivilege: withAudio ? _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
|
|
616
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
617
|
+
}));
|
|
618
|
+
if (withAudio) {
|
|
619
|
+
this._handleShareStartWithAudio();
|
|
620
|
+
} else {
|
|
621
|
+
this._handleShareStopWithAudio();
|
|
622
|
+
}
|
|
623
|
+
}
|
|
271
624
|
}
|
|
272
|
-
|
|
273
|
-
// private _closeVideoWindowDialog() {
|
|
274
|
-
// // this._eventProvider.closeDialog(this._videoWindowDialogId);
|
|
275
|
-
// // this._videoWindowDialogId = '';
|
|
276
|
-
// this._eventProvider.sendEvent(FcrUIAction.CLOSE_VIDEO_WINDOW);
|
|
277
|
-
// }
|
|
278
625
|
}, {
|
|
279
|
-
key: "
|
|
626
|
+
key: "_getExcludeWindows",
|
|
280
627
|
value: function () {
|
|
281
|
-
var
|
|
282
|
-
var
|
|
283
|
-
return _regenerator["default"].wrap(function
|
|
284
|
-
while (1) switch (
|
|
628
|
+
var _getExcludeWindows2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
629
|
+
var excludeWindows;
|
|
630
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
631
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
285
632
|
case 0:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return
|
|
633
|
+
excludeWindows = [];
|
|
634
|
+
_context5.next = 3;
|
|
635
|
+
return (0, _tools.waitUntil)(function () {
|
|
636
|
+
var _getControlBarMediaSo, _getVideoWindowMediaS, _getAnnotationMediaSo, _getAnnotationMediaSo2;
|
|
637
|
+
var windowId = (_getControlBarMediaSo = (0, _rendererEvent.getControlBarMediaSourceId)()) !== null && _getControlBarMediaSo !== void 0 ? _getControlBarMediaSo : '';
|
|
638
|
+
var _windowId$split = windowId.split(':'),
|
|
639
|
+
_windowId$split2 = (0, _slicedToArray2["default"])(_windowId$split, 2),
|
|
640
|
+
videoWindowId = _windowId$split2[1];
|
|
641
|
+
if (videoWindowId && !excludeWindows.includes(videoWindowId)) {
|
|
642
|
+
excludeWindows.push(videoWindowId);
|
|
643
|
+
}
|
|
644
|
+
windowId = (_getVideoWindowMediaS = (0, _rendererEvent.getVideoWindowMediaSourceId)()) !== null && _getVideoWindowMediaS !== void 0 ? _getVideoWindowMediaS : '';
|
|
645
|
+
var _windowId$split3 = windowId.split(':'),
|
|
646
|
+
_windowId$split4 = (0, _slicedToArray2["default"])(_windowId$split3, 2),
|
|
647
|
+
controlBarWindowId = _windowId$split4[1];
|
|
648
|
+
if (controlBarWindowId && !excludeWindows.includes(controlBarWindowId)) {
|
|
649
|
+
excludeWindows.push(controlBarWindowId);
|
|
650
|
+
}
|
|
651
|
+
windowId = (_getAnnotationMediaSo = (0, _rendererEvent.getAnnotationMediaSourceId)('Annotation')) !== null && _getAnnotationMediaSo !== void 0 ? _getAnnotationMediaSo : '';
|
|
652
|
+
var _windowId$split5 = windowId.split(':'),
|
|
653
|
+
_windowId$split6 = (0, _slicedToArray2["default"])(_windowId$split5, 2),
|
|
654
|
+
annotationWindowId = _windowId$split6[1];
|
|
655
|
+
if (annotationWindowId && !excludeWindows.includes(annotationWindowId)) {
|
|
656
|
+
excludeWindows.push(annotationWindowId);
|
|
657
|
+
}
|
|
658
|
+
windowId = (_getAnnotationMediaSo2 = (0, _rendererEvent.getAnnotationMediaSourceId)('Annotation tool bar')) !== null && _getAnnotationMediaSo2 !== void 0 ? _getAnnotationMediaSo2 : '';
|
|
659
|
+
var _windowId$split7 = windowId.split(':'),
|
|
660
|
+
_windowId$split8 = (0, _slicedToArray2["default"])(_windowId$split7, 2),
|
|
661
|
+
annotationToolWindowId = _windowId$split8[1];
|
|
662
|
+
if (annotationToolWindowId && !excludeWindows.includes(annotationToolWindowId)) {
|
|
663
|
+
excludeWindows.push(annotationToolWindowId);
|
|
664
|
+
}
|
|
665
|
+
return !!videoWindowId && !!controlBarWindowId;
|
|
666
|
+
}, 'control bar is open');
|
|
289
667
|
case 3:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
_context.next = 6;
|
|
294
|
-
return this._deviceProvider.getDisplayList();
|
|
295
|
-
case 6:
|
|
296
|
-
displayList = _context.sent;
|
|
297
|
-
this.applicationCaptureSources = windowList.filter(function (item) {
|
|
298
|
-
return !item.isCurrent;
|
|
299
|
-
});
|
|
300
|
-
this.screenCaptureSources = [{
|
|
301
|
-
title: (0, _i18n.transI18n)('fmt_share_options_whiteboard'),
|
|
302
|
-
id: "whiteboard-".concat(displayList[0].id),
|
|
303
|
-
image: _type.FcrIconType.FCR_WHITEBOARD2
|
|
304
|
-
}].concat((0, _toConsumableArray2["default"])(displayList));
|
|
305
|
-
case 9:
|
|
668
|
+
this.logger.info('exclude win:', JSON.stringify(excludeWindows));
|
|
669
|
+
return _context5.abrupt("return", excludeWindows);
|
|
670
|
+
case 5:
|
|
306
671
|
case "end":
|
|
307
|
-
return
|
|
672
|
+
return _context5.stop();
|
|
308
673
|
}
|
|
309
|
-
},
|
|
674
|
+
}, _callee5, this);
|
|
310
675
|
}));
|
|
311
|
-
function
|
|
312
|
-
return
|
|
676
|
+
function _getExcludeWindows() {
|
|
677
|
+
return _getExcludeWindows2.apply(this, arguments);
|
|
313
678
|
}
|
|
314
|
-
return
|
|
679
|
+
return _getExcludeWindows;
|
|
315
680
|
}()
|
|
681
|
+
}, {
|
|
682
|
+
key: "removeScreenStream",
|
|
683
|
+
value: function removeScreenStream() {
|
|
684
|
+
try {
|
|
685
|
+
var _this$_streamControl5;
|
|
686
|
+
this.logger.info('screen-share-provider: remove screen streams');
|
|
687
|
+
(_this$_streamControl5 = this._streamControl) === null || _this$_streamControl5 === void 0 || _this$_streamControl5.removeScreenStream();
|
|
688
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId('');
|
|
689
|
+
return true;
|
|
690
|
+
} catch (error) {
|
|
691
|
+
this.logger.error('removeScreenStream error', error);
|
|
692
|
+
return false;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}, {
|
|
696
|
+
key: "_screenTrackStop",
|
|
697
|
+
value: function _screenTrackStop() {
|
|
698
|
+
var _this$screenTrack6;
|
|
699
|
+
this.logger.info('screen-share-provider: current screen track stop');
|
|
700
|
+
(_this$screenTrack6 = this.screenTrack) === null || _this$screenTrack6 === void 0 || _this$screenTrack6.stop();
|
|
701
|
+
this.setShareLock(false);
|
|
702
|
+
}
|
|
316
703
|
}]);
|
|
317
704
|
}();
|
|
318
705
|
_FcrUIScreenShareProviderImpl = FcrUIScreenShareProviderImpl;
|
|
319
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIScreenShareProviderImpl, [[
|
|
320
|
-
|
|
321
|
-
_init_screenCaptureSources = _applyDecs$e[1];
|
|
322
|
-
_init_shareSelectionDialogId = _applyDecs$e[2];
|
|
323
|
-
_init_isSharingScreen = _applyDecs$e[3];
|
|
324
|
-
_init_isSeizeStream = _applyDecs$e[4];
|
|
325
|
-
_init_screenSharingOwner = _applyDecs$e[5];
|
|
326
|
-
_initProto = _applyDecs$e[6];
|
|
706
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIScreenShareProviderImpl, [[_decorator.bound, 2, "getCurrentScreenSharingOwner"], [_decorator.bound, 2, "stop"], [_decorator.bound, 2, "bootstrap"], [_decorator.bound, 2, "_handleWebScreenCaptureStateUpdated"], [_handleScreenCaptureStateUpdatedDecs, 18, "_handleScreenCaptureStateUpdated"], [_handleShareStopWithAudioDecs, 18, "_handleShareStopWithAudio"], [_replaceScreenShareDecs, 18, "replaceScreenShare"], [_decorator.bound, 2, "_syncShareStreamState"], [_handleStreamUpdateDecs, 18, "_handleStreamUpdate"], [_decorator.bound, 2, "startRenderSharePreview"], [_decorator.bound, 2, "stopRenderSharePreview"], [_handleStreamPublicDecs, 18, "_handleStreamPublic"], [_releaseDecs, 18, "release"], [_startShareScreenDecs, 18, "startShareScreen"], [_handleShareStartWithAudioDecs, 18, "_handleShareStartWithAudio"], [_decorator.bound, 2, "_getExcludeWindows"], [_decorator.bound, 2, "_screenTrackStop"]], []).e, 1);
|
|
707
|
+
_initProto = _applyDecs$e[0];
|
|
327
708
|
(0, _base.registerDependency)('screenShareProvider');
|