fcr-ui-scene 3.6.0 → 3.6.2
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/dist/132.js +2 -0
- package/dist/132.js.LICENSE.txt +311 -0
- package/dist/317.js +2 -0
- package/dist/317.js.LICENSE.txt +20 -0
- package/dist/651.js +2 -0
- package/dist/651.js.LICENSE.txt +1 -0
- package/dist/689343b64b60bfb7ffff.png +0 -0
- package/dist/73.js +1 -0
- package/dist/885f9369ea05a8ac0e56.png +0 -0
- package/dist/90f383876a6e93e7c7ca.png +0 -0
- package/dist/9b37584780995fc5df8c.gif +0 -0
- package/dist/annotation.e5cbd3a70b6d42361872.css +1274 -0
- package/dist/annotation.html +1 -0
- package/dist/annotation.js +2 -0
- package/dist/annotation.js.LICENSE.txt +252 -0
- package/dist/assets/browser/images/default1.jpg +0 -0
- package/dist/assets/browser/images/default2.jpg +0 -0
- package/dist/assets/browser/images/default3.jpg +0 -0
- package/dist/assets/browser/images/default4.jpg +0 -0
- package/dist/assets/browser/images/default5.jpg +0 -0
- package/dist/assets/browser/images/default6.jpg +0 -0
- package/dist/assets/browser/images/default7.jpg +0 -0
- package/dist/assets/browser/sound_effects/pretest.mp3 +0 -0
- package/dist/assets/browser/sound_effects/recording_started.mp3 +0 -0
- package/dist/assets/browser/sound_effects/remote_user_joined.mp3 +0 -0
- package/dist/assets/browser/sound_effects/speaker_test.mp3 +0 -0
- package/dist/assets/browser/videos/default8.mp4 +0 -0
- package/dist/assets/browser/videos/default9.mp4 +0 -0
- package/dist/assets/cursors/fcr_whiteboard_input.ico +0 -0
- package/dist/assets/cursors/fcr_whiteboard_pen.ico +0 -0
- package/dist/assets/cursors/fcr_whiteboard_shape_-straightline.ico +0 -0
- package/dist/assets/cursors/fcr_whiteboard_shape_arrow.ico +0 -0
- package/dist/assets/cursors/fcr_whiteboard_shape_circle.ico +0 -0
- package/dist/assets/cursors/fcr_whiteboard_shape_rectangle.ico +0 -0
- package/dist/assets/cursors/fcr_whiteboard_shape_triangle.ico +0 -0
- package/dist/assets/electron/images/default1.jpg +0 -0
- package/dist/assets/electron/images/default2.jpg +0 -0
- package/dist/assets/electron/sound_effects/pretest.mp3 +0 -0
- package/dist/assets/electron/videos/default8.mp4 +0 -0
- package/dist/assets/fcr_chat_reddot.svg +5 -0
- package/dist/assets/fcr_defaultpage.png +0 -0
- package/dist/assets/fcr_grid_big.svg +3 -0
- package/dist/assets/fcr_leave2.svg +58 -0
- package/dist/assets/fcr_listontop_big.svg +3 -0
- package/dist/assets/full-screen-error-boundary-img.png +0 -0
- package/dist/assets/leave-meeting.png +0 -0
- package/dist/assets/loading.gif +0 -0
- package/dist/assets/login_confirm.png +0 -0
- package/dist/assets/pretest.mp3 +0 -0
- package/dist/assets/state-bar-logo.png +0 -0
- package/dist/assets/step-gradient.svg +10 -0
- package/dist/b74b002687a3a3346bec.png +0 -0
- package/dist/b94869094481702f949b.png +0 -0
- package/dist/ebeace75fd46b90d890e.png +0 -0
- package/dist/electron/app.js +194 -0
- package/dist/electron/bootstrap-dev.js +46 -0
- package/dist/electron/bootstrap-sdk.js +211 -0
- package/dist/electron/default-options.js +25 -0
- package/dist/electron/env.js +13 -0
- package/dist/electron/index.js +20 -0
- package/dist/electron/injections.js +903 -0
- package/dist/electron/ipc/ipc.js +141 -0
- package/dist/electron/ipc/type.js +19 -0
- package/dist/electron/logger.js +65 -0
- package/dist/electron/main.js +94 -0
- package/dist/electron/plugins/devtool-shortcut.js +33 -0
- package/dist/electron/plugins/meeting-state.js +39 -0
- package/dist/electron/plugins/screenshot.js +54 -0
- package/dist/electron/preload.js +108 -0
- package/dist/electron/tools.js +66 -0
- package/dist/electron/window.js +123 -0
- package/dist/extensions/agora-extension-virtual-background/agora-wasm.wasm +0 -0
- package/dist/extensions/ai-denoiser/denoiser-wasm-simd.wasm +0 -0
- package/dist/extensions/ai-denoiser/denoiser-wasm.js +1 -0
- package/dist/extensions/ai-denoiser/denoiser-wasm.wasm +0 -0
- package/dist/fad688b9135b15d6c405.png +0 -0
- package/dist/index.html +224 -0
- package/dist/main.393a2a91ab7fc05ffce6.css +15403 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +272 -0
- package/dist/worker-entry.worker.js.LICENSE.txt +13 -0
- package/lib/creator.d.ts +5 -0
- package/lib/creator.js +106 -17
- package/lib/electron/bootstrap-sdk.js +19 -6
- package/lib/electron/injections.d.ts +4 -0
- package/lib/electron/injections.js +37 -8
- package/lib/electron/ipc/ipc.d.ts +1 -0
- package/lib/electron/ipc/ipc.js +4 -0
- package/lib/electron/main.js +6 -2
- package/lib/electron/plugins/screenshot.js +4 -2
- package/lib/electron/preload.js +7 -2
- package/lib/electron/window.js +4 -3
- package/lib/fragments/annotation/index.d.ts +10 -0
- package/lib/fragments/annotation/index.js +106 -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 +25 -0
- package/lib/fragments/annotation/store.js +485 -0
- package/lib/fragments/annotation/view.d.ts +2 -0
- package/lib/fragments/annotation/view.js +23 -0
- package/lib/fragments/base.d.ts +10 -0
- package/lib/fragments/base.js +44 -0
- package/lib/global.css +23 -5
- package/lib/modules/action-bar/components/board/index.js +0 -2
- package/lib/modules/action-bar/components/breakout-room/index.js +0 -2
- package/lib/modules/action-bar/components/leave/index.js +1 -12
- package/lib/modules/action-bar/components/more/poppover-content.js +6 -9
- package/lib/modules/action-bar/components/participants/index.js +1 -9
- package/lib/modules/action-bar/components/screen-share/index.js +0 -4
- package/lib/modules/action-bar/components/screen-share/submenu.js +7 -6
- package/lib/modules/action-bar/index.css +7 -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 +6 -4
- package/lib/modules/action-bar/store.js +19 -19
- package/lib/modules/action-bar/view.js +1 -1
- 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 +101 -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 +59 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +11 -0
- package/lib/modules/annotation/components/toolbar/components/graphic-tool/graphic-panel/libs.js +59 -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 +17 -0
- package/lib/modules/annotation/components/toolbar/components/item/item.js +115 -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 +36 -0
- package/lib/modules/annotation/index.js +168 -0
- package/lib/modules/annotation/store.d.ts +85 -0
- package/lib/modules/annotation/store.js +648 -0
- package/lib/modules/annotation/style.css +26 -0
- package/lib/modules/annotation/view.d.ts +2 -0
- package/lib/modules/annotation/view.js +32 -0
- package/lib/modules/audio-stream/index.js +4 -4
- package/lib/modules/chat/chat-room-store.js +3 -4
- 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/icon-buttons/index.d.ts +2 -0
- package/lib/modules/components/member-window/components/member-actions/components/icon-buttons/index.js +6 -3
- package/lib/modules/components/member-window/components/member-actions/index.js +0 -2
- package/lib/modules/components/member-window/components/member-actions/libs/index.js +0 -1
- 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 +5 -1
- package/lib/modules/components/member-window/components/video-player/index.d.ts +1 -0
- package/lib/modules/components/member-window/index.css +1 -0
- package/lib/modules/components/member-window/index.d.ts +1 -1
- package/lib/modules/components/member-window/index.js +8 -6
- package/lib/modules/components/member-window/types.d.ts +2 -0
- package/lib/modules/components/security-menu/index.js +7 -6
- package/lib/modules/connection-gateway/components/phone/index.js +1 -1
- 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 -2
- package/lib/modules/control-bar/index.js +5 -2
- package/lib/modules/control-bar/store.d.ts +24 -8
- package/lib/modules/control-bar/store.js +116 -81
- package/lib/modules/control-bar/view.js +7 -3
- 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/dialog-container/index.css +16 -0
- 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/share-screen-selection/index.js +1 -2
- 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 +22 -90
- package/lib/modules/dialog/index.d.ts +2 -0
- package/lib/modules/dialog/index.js +2 -2
- package/lib/modules/dialog/store.d.ts +9 -2
- package/lib/modules/dialog/store.js +46 -6
- 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 +40 -25
- package/lib/modules/event-confirm/view.js +23 -171
- package/lib/modules/event-sound/index.js +1 -1
- package/lib/modules/event-toast/store.js +5 -2
- package/lib/modules/invite/components/pstn-invite.js +0 -17
- package/lib/modules/layout/components/Aside.js +0 -1
- package/lib/modules/layout/components/CommonVideoRenderer.js +30 -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 +84 -46
- package/lib/modules/participant/components/participants/components/footer/components/footer/index.js +0 -2
- 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 +45 -28
- package/lib/modules/pc-audio-connect/store.js +2 -1
- package/lib/modules/setting/audio-settings/audio-settings.js +3 -14
- 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 +38 -46
- package/lib/modules/share-screen/store.js +263 -693
- 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.d.ts +2 -0
- package/lib/modules/state-bar/index.js +1 -0
- package/lib/modules/state-bar/meeting-details.js +3 -9
- package/lib/modules/state-bar/store.d.ts +5 -1
- package/lib/modules/state-bar/store.js +9 -1
- package/lib/modules/state-bar/view.js +3 -2
- 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/index.js +0 -2
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +5 -1
- package/lib/modules/whiteboard/components/control-bar/store.js +8 -1
- package/lib/modules/whiteboard/components/scene-pagination.js +0 -2
- package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.js +1 -2
- 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 +9 -2
- package/lib/modules/whiteboard/components/toolbar/store.js +30 -6
- 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 +20 -20
- package/lib/modules/widget/sdk.js +0 -1
- package/lib/plugins/browser-runtime-plugin.js +10 -1
- package/lib/providers/annotation-provider.d.ts +77 -0
- package/lib/providers/annotation-provider.js +411 -0
- package/lib/providers/device-provider.js +4 -20
- 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 +561 -173
- package/lib/providers/sharing-provider.d.ts +33 -0
- package/lib/{shared-data-source/screen-share-data-source.js → providers/sharing-provider.js} +87 -39
- package/lib/runtime.d.ts +6 -1
- package/lib/scenes/main-scene.d.ts +7 -2
- package/lib/scenes/main-scene.js +54 -25
- package/lib/scenes/waiting-scene.d.ts +6 -0
- package/lib/scenes/waiting-scene.js +15 -5
- package/lib/shared-data-source/meeting-time.js +2 -2
- 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 +270 -0
- package/lib/shared-data-source/screen-share-data.js +389 -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.js +6 -4
- package/lib/shared-data-source/video-window.d.ts +0 -1
- package/lib/shared-data-source/video-window.js +3 -10
- package/lib/type.d.ts +53 -0
- package/lib/ui-manager.d.ts +3 -2
- package/lib/ui-manager.js +6 -4
- package/lib/ui-scene.js +61 -48
- package/lib/utilities/constant.d.ts +8 -1
- package/lib/utilities/constant.js +7 -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/tools.d.ts +43 -3
- package/lib/utilities/tools.js +81 -17
- package/lib/waiting-room-control-manager.js +1 -1
- package/package.json +7 -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", {
|
|
@@ -38,167 +40,449 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
38
40
|
});
|
|
39
41
|
exports.FcrUIScreenShareProviderImpl = void 0;
|
|
40
42
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
41
|
-
require("core-js/modules/es.array.concat.js");
|
|
42
|
-
require("core-js/modules/es.array.filter.js");
|
|
43
43
|
require("core-js/modules/es.array.find.js");
|
|
44
44
|
require("core-js/modules/es.array.includes.js");
|
|
45
|
-
require("core-js/modules/es.array.
|
|
45
|
+
require("core-js/modules/es.array.push.js");
|
|
46
46
|
require("core-js/modules/es.array.some.js");
|
|
47
|
+
require("core-js/modules/es.date.to-json.js");
|
|
48
|
+
require("core-js/modules/es.json.stringify.js");
|
|
47
49
|
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/
|
|
50
|
+
require("core-js/modules/es.promise.js");
|
|
51
|
+
require("core-js/modules/es.promise.finally.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, _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], _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",
|
|
127
|
+
get: function get() {
|
|
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
|
+
}
|
|
186
|
+
if (state === _fcrCore.FcrMediaSourceState.ERROR) {
|
|
187
|
+
this.setShareLock(false);
|
|
188
|
+
this._setIsReplaceScreen(false);
|
|
189
|
+
}
|
|
190
|
+
case 9:
|
|
191
|
+
case "end":
|
|
192
|
+
return _context.stop();
|
|
193
|
+
}
|
|
194
|
+
}, _callee, this);
|
|
195
|
+
}));
|
|
196
|
+
function _handleWebScreenCaptureStateUpdated(_x, _x2) {
|
|
197
|
+
return _handleWebScreenCaptureStateUpdated2.apply(this, arguments);
|
|
198
|
+
}
|
|
199
|
+
return _handleWebScreenCaptureStateUpdated;
|
|
200
|
+
}()
|
|
201
|
+
}, {
|
|
202
|
+
key: "_handleScreenCaptureStateUpdated",
|
|
203
|
+
value: function _handleScreenCaptureStateUpdated(sourceId, state) {
|
|
204
|
+
this.logger.info('screen-share-provider _handleScreenCaptureStateUpdated: ', sourceId, ' ==== ', state);
|
|
205
|
+
if (state === _fcrCore.FcrMediaSourceState.CLOSE) {
|
|
206
|
+
var _this$screenTrack2;
|
|
207
|
+
this.stopRenderSharePreview(this.screenTrack);
|
|
208
|
+
(_this$screenTrack2 = this.screenTrack) === null || _this$screenTrack2 === void 0 || _this$screenTrack2.removeObserver(this._screenCaptureObserver);
|
|
209
|
+
this.isReplaceScreen ? this._screenTrackStop() : this.stop();
|
|
210
|
+
this._setIsReplaceScreen(false);
|
|
211
|
+
}
|
|
212
|
+
if (state === _fcrCore.FcrMediaSourceState.ERROR) {
|
|
213
|
+
this.stop();
|
|
214
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingState(_fcrCore.FcrMediaSourceState.CLOSE);
|
|
215
|
+
this._setIsReplaceScreen(false);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingState(state);
|
|
219
|
+
}
|
|
220
|
+
}, {
|
|
221
|
+
key: "_handleShareStopWithAudio",
|
|
222
|
+
value: function _handleShareStopWithAudio() {
|
|
223
|
+
if (!this.shareAudioTrack) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE)) {
|
|
227
|
+
this.shareAudioTrack.stop();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}, {
|
|
231
|
+
key: "replaceScreenShare",
|
|
232
|
+
value: function replaceScreenShare(id, type, withAudio, bounds) {
|
|
233
|
+
var _this2 = this;
|
|
234
|
+
var shareWithAudio = (0, _lodash.isBoolean)(withAudio) ? withAudio : this._sharedScreenShareSharedDataSource.shareWithAudio;
|
|
235
|
+
this.toggleScreenshareWithAudio(shareWithAudio);
|
|
236
|
+
this._sharedScreenShareSharedDataSource.setIsReplaceScreen(true);
|
|
237
|
+
if (this.screenTrack) {
|
|
238
|
+
var _this$screenTrack3;
|
|
239
|
+
var _observer = {
|
|
240
|
+
onScreenCaptureStateUpdated: function () {
|
|
241
|
+
var _onScreenCaptureStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(sourceId, state) {
|
|
242
|
+
var _this2$screenTrack;
|
|
243
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
244
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
245
|
+
case 0:
|
|
246
|
+
if (!(state === _fcrCore.FcrMediaSourceState.CLOSE)) {
|
|
247
|
+
_context2.next = 7;
|
|
248
|
+
break;
|
|
249
|
+
}
|
|
250
|
+
_this2._observable.notifyObservers('onScreenShareReplaceBegin', id, type, bounds);
|
|
251
|
+
(_this2$screenTrack = _this2.screenTrack) === null || _this2$screenTrack === void 0 || _this2$screenTrack.removeObserver(_observer);
|
|
252
|
+
_context2.next = 5;
|
|
253
|
+
return _this2.startShareScreen(id, type, withAudio, true);
|
|
254
|
+
case 5:
|
|
255
|
+
_this2._sharedScreenShareSharedDataSource.setCurrentShareIdInfos(id, type, bounds);
|
|
256
|
+
if (_this2.currentShareStreamId && _this2._streamControl) {
|
|
257
|
+
_this2._streamControl.bindLocalStreams([{
|
|
258
|
+
streamId: _this2.currentShareStreamId,
|
|
259
|
+
audioSourceId: _this2.loopbackAudioSourceId,
|
|
260
|
+
videoSourceId: id
|
|
261
|
+
}]);
|
|
262
|
+
}
|
|
263
|
+
case 7:
|
|
264
|
+
case "end":
|
|
265
|
+
return _context2.stop();
|
|
266
|
+
}
|
|
267
|
+
}, _callee2);
|
|
268
|
+
}));
|
|
269
|
+
function onScreenCaptureStateUpdated(_x3, _x4) {
|
|
270
|
+
return _onScreenCaptureStateUpdated.apply(this, arguments);
|
|
271
|
+
}
|
|
272
|
+
return onScreenCaptureStateUpdated;
|
|
273
|
+
}()
|
|
274
|
+
};
|
|
275
|
+
(_this$screenTrack3 = this.screenTrack) === null || _this$screenTrack3 === void 0 || _this$screenTrack3.addObserver(_observer);
|
|
276
|
+
this._screenTrackStop();
|
|
277
|
+
this.stopRenderSharePreview(this.screenTrack);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}, {
|
|
281
|
+
key: "_setIsReplaceScreen",
|
|
282
|
+
value: function _setIsReplaceScreen(isReplace) {
|
|
283
|
+
this._sharedScreenShareSharedDataSource.setIsReplaceScreen(isReplace);
|
|
284
|
+
}
|
|
285
|
+
}, {
|
|
286
|
+
key: "isReplaceScreen",
|
|
125
287
|
get: function get() {
|
|
126
|
-
return
|
|
127
|
-
},
|
|
128
|
-
set: function set(v) {
|
|
129
|
-
_classPrivateFieldSet(_A, this, v);
|
|
288
|
+
return this._sharedScreenShareSharedDataSource.isReplaceScreen;
|
|
130
289
|
}
|
|
131
290
|
}, {
|
|
132
|
-
key: "
|
|
291
|
+
key: "localUserId",
|
|
133
292
|
get: function get() {
|
|
134
|
-
return
|
|
135
|
-
},
|
|
136
|
-
set: function set(v) {
|
|
137
|
-
_classPrivateFieldSet(_B, this, v);
|
|
293
|
+
return this._sharedMemberDataSource.localUser.userId;
|
|
138
294
|
}
|
|
139
295
|
}, {
|
|
140
|
-
key: "
|
|
296
|
+
key: "shareAudioTrack",
|
|
141
297
|
get: function get() {
|
|
142
|
-
return
|
|
143
|
-
},
|
|
144
|
-
set: function set(v) {
|
|
145
|
-
_classPrivateFieldSet(_C, this, v);
|
|
298
|
+
return this._sharedScreenShareSharedDataSource.shareWithAudioTrack;
|
|
146
299
|
}
|
|
147
300
|
}, {
|
|
148
|
-
key: "
|
|
301
|
+
key: "loopbackAudioSourceId",
|
|
149
302
|
get: function get() {
|
|
150
|
-
return
|
|
151
|
-
},
|
|
152
|
-
set: function set(v) {
|
|
153
|
-
_classPrivateFieldSet(_D, this, v);
|
|
303
|
+
return this._sharedScreenShareSharedDataSource.loopbackAudioSourceId;
|
|
154
304
|
}
|
|
155
305
|
}, {
|
|
156
|
-
key: "
|
|
306
|
+
key: "currentShareId",
|
|
157
307
|
get: function get() {
|
|
158
|
-
return
|
|
159
|
-
},
|
|
160
|
-
set: function set(v) {
|
|
161
|
-
_classPrivateFieldSet(_E, this, v);
|
|
308
|
+
return this._sharedScreenShareSharedDataSource.currentShareId;
|
|
162
309
|
}
|
|
163
310
|
}, {
|
|
164
|
-
key: "
|
|
311
|
+
key: "screenTrack",
|
|
165
312
|
get: function get() {
|
|
166
|
-
return
|
|
167
|
-
},
|
|
168
|
-
set: function set(v) {
|
|
169
|
-
_classPrivateFieldSet(_F, this, v);
|
|
313
|
+
return this._sharedScreenShareSharedDataSource.screenTrack;
|
|
170
314
|
}
|
|
171
315
|
}, {
|
|
172
|
-
key: "
|
|
173
|
-
|
|
174
|
-
this.
|
|
316
|
+
key: "currentShareStreamId",
|
|
317
|
+
get: function get() {
|
|
318
|
+
return this._sharedScreenShareSharedDataSource.currentShareStreamId;
|
|
175
319
|
}
|
|
176
320
|
}, {
|
|
177
|
-
key: "
|
|
178
|
-
|
|
179
|
-
this.
|
|
321
|
+
key: "currentSelectionBounds",
|
|
322
|
+
get: function get() {
|
|
323
|
+
return this._sharedScreenShareSharedDataSource.currentSelectionBounds;
|
|
180
324
|
}
|
|
181
325
|
}, {
|
|
182
|
-
key: "
|
|
183
|
-
value: function
|
|
326
|
+
key: "setShareLock",
|
|
327
|
+
value: function setShareLock(lock) {
|
|
328
|
+
this.shareLock = lock;
|
|
329
|
+
}
|
|
330
|
+
}, {
|
|
331
|
+
key: "createScreenShareWithSelectionId",
|
|
332
|
+
value: function () {
|
|
333
|
+
var _createScreenShareWithSelectionId = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(videoSourceId, bounds) {
|
|
334
|
+
var _this3 = this;
|
|
335
|
+
var audioSourceId, _this$_sharingControl, streamId;
|
|
336
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
337
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
338
|
+
case 0:
|
|
339
|
+
this.logger.info('screen-share-provider: createScreenShareWithSelectionId: ', videoSourceId);
|
|
340
|
+
this.setShareLock(true);
|
|
341
|
+
audioSourceId = this.loopbackAudioSourceId;
|
|
342
|
+
if (!this._sharingControl) {
|
|
343
|
+
_context3.next = 10;
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
_context3.next = 6;
|
|
347
|
+
return (_this$_sharingControl = this._sharingControl) === null || _this$_sharingControl === void 0 ? void 0 : _this$_sharingControl.startScreenSharing({
|
|
348
|
+
streamType: _imports.AgoraRteMediaStreamType.BOTH,
|
|
349
|
+
videoSourceId: videoSourceId,
|
|
350
|
+
audioSourceId: audioSourceId
|
|
351
|
+
}, bounds)["finally"](function () {
|
|
352
|
+
_this3.setShareLock(false);
|
|
353
|
+
});
|
|
354
|
+
case 6:
|
|
355
|
+
streamId = _context3.sent;
|
|
356
|
+
return _context3.abrupt("return", Promise.resolve(streamId));
|
|
357
|
+
case 10:
|
|
358
|
+
return _context3.abrupt("return", Promise.reject());
|
|
359
|
+
case 11:
|
|
360
|
+
case "end":
|
|
361
|
+
return _context3.stop();
|
|
362
|
+
}
|
|
363
|
+
}, _callee3, this);
|
|
364
|
+
}));
|
|
365
|
+
function createScreenShareWithSelectionId(_x5, _x6) {
|
|
366
|
+
return _createScreenShareWithSelectionId.apply(this, arguments);
|
|
367
|
+
}
|
|
368
|
+
return createScreenShareWithSelectionId;
|
|
369
|
+
}()
|
|
370
|
+
}, {
|
|
371
|
+
key: "_isStoppedFor",
|
|
372
|
+
value: function _isStoppedFor(events, reason) {
|
|
373
|
+
var _this4 = this;
|
|
374
|
+
return events && events.find(function (event) {
|
|
375
|
+
var _event$cause;
|
|
376
|
+
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 === _this4.localUserId;
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
}, {
|
|
380
|
+
key: "_addEventListeners",
|
|
381
|
+
value: function _addEventListeners() {
|
|
382
|
+
window.addEventListener('online', this._syncShareStreamState);
|
|
383
|
+
}
|
|
384
|
+
}, {
|
|
385
|
+
key: "_removeEventListeners",
|
|
386
|
+
value: function _removeEventListeners() {
|
|
387
|
+
window.removeEventListener('online', this._syncShareStreamState);
|
|
388
|
+
}
|
|
389
|
+
}, {
|
|
390
|
+
key: "_syncShareStreamState",
|
|
391
|
+
value: function _syncShareStreamState() {
|
|
392
|
+
var _this$_streamControl3,
|
|
393
|
+
_this5 = this;
|
|
394
|
+
var currentShareStreamId = this.currentShareStreamId || ((_this$_streamControl3 = this._streamControl) === null || _this$_streamControl3 === void 0 || (_this$_streamControl3 = _this$_streamControl3.getStreamList().find(function (stream) {
|
|
395
|
+
return stream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN && stream.owner.userId === _this5.localUserId;
|
|
396
|
+
})) === null || _this$_streamControl3 === void 0 ? void 0 : _this$_streamControl3.streamId);
|
|
397
|
+
if (this._sharedScreenShareSharedDataSource.screenSharingState !== _fcrCore.FcrMediaSourceState.OPEN && currentShareStreamId) {
|
|
398
|
+
this.stop();
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}, {
|
|
402
|
+
key: "_handleStreamUpdate",
|
|
403
|
+
value: function _handleStreamUpdate(process, events) {
|
|
404
|
+
var _this6 = this;
|
|
184
405
|
this._handleStreamPublic();
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
406
|
+
var isClosedByOther = this._isStoppedFor(events, _types.FcrBoardInactiveReason.CLOSE);
|
|
407
|
+
var isSeizedByOther = this._isStoppedFor(events, _types.FcrBoardInactiveReason.SEIZE);
|
|
408
|
+
var operatorUser = (isSeizedByOther === null || isSeizedByOther === void 0 ? void 0 : isSeizedByOther.operatorUser) || (isClosedByOther === null || isClosedByOther === void 0 ? void 0 : isClosedByOther.operatorUser);
|
|
409
|
+
var ownerUser = (isSeizedByOther === null || isSeizedByOther === void 0 ? void 0 : isSeizedByOther.modifiedStream.owner) || (isClosedByOther === null || isClosedByOther === void 0 ? void 0 : isClosedByOther.modifiedStream.owner);
|
|
410
|
+
var selfOperated = (operatorUser === null || operatorUser === void 0 ? void 0 : operatorUser.userId) === this.localUserId;
|
|
411
|
+
var isMyOwnShare = this.localUserId === (ownerUser === null || ownerUser === void 0 ? void 0 : ownerUser.userId);
|
|
412
|
+
if ((isSeizedByOther || isClosedByOther) && !selfOperated) {
|
|
413
|
+
this._screenTrackStop();
|
|
414
|
+
}
|
|
415
|
+
isClosedByOther && !selfOperated && isMyOwnShare && this._eventProvider.sendEvent(_constant.FcrUIAction.SHOW_TOAST, {
|
|
416
|
+
type: 'info',
|
|
417
|
+
message: (0, _i18n.transI18n)('fmt_share_tips_sharingdisabled')
|
|
188
418
|
});
|
|
419
|
+
switch (process) {
|
|
420
|
+
case 'add':
|
|
421
|
+
var newsStreamsHaveScreenShare = events.some(function (event) {
|
|
422
|
+
return event.modifiedStream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN;
|
|
423
|
+
});
|
|
424
|
+
var isSeizeStreamAdd = newsStreamsHaveScreenShare && this._sharedScreenShareSharedDataSource.isSharingScreen;
|
|
425
|
+
this._sharedScreenShareSharedDataSource.setIsSeizeStream(isSeizeStreamAdd);
|
|
426
|
+
break;
|
|
427
|
+
case 'remove':
|
|
428
|
+
var isSeizeStreamRemove = events.some(function (event) {
|
|
429
|
+
var _event$cause2, _event$operatorUser;
|
|
430
|
+
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;
|
|
431
|
+
});
|
|
432
|
+
this._sharedScreenShareSharedDataSource.setIsSeizeStream(isSeizeStreamRemove);
|
|
433
|
+
this.logger.info('screen-share-provider: stream update remove', isSeizeStreamRemove);
|
|
434
|
+
if (events.some(function (event) {
|
|
435
|
+
return event.modifiedStream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN && event.modifiedStream.owner.userId === _this6.localUserId;
|
|
436
|
+
})) {
|
|
437
|
+
if (!(0, _env.isElectron)() && this.isReplaceScreen) {
|
|
438
|
+
this._setIsReplaceScreen(false);
|
|
439
|
+
return;
|
|
440
|
+
} // web 下如果是替换的逻辑,不需要关闭分享
|
|
441
|
+
this.logger.info('screen-share-provider: current user stream remove');
|
|
442
|
+
this._screenTrackStop();
|
|
443
|
+
}
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}, {
|
|
448
|
+
key: "startRenderSharePreview",
|
|
449
|
+
value: function startRenderSharePreview(dom, targetScreenTrack) {
|
|
450
|
+
this._previewDom = dom;
|
|
451
|
+
var screenTrack = targetScreenTrack !== null && targetScreenTrack !== void 0 ? targetScreenTrack : this.screenTrack;
|
|
452
|
+
if (dom) {
|
|
453
|
+
screenTrack === null || screenTrack === void 0 || screenTrack.startPreview({
|
|
454
|
+
renderMode: 1,
|
|
455
|
+
isMirror: false
|
|
456
|
+
}, dom);
|
|
457
|
+
} else {
|
|
458
|
+
screenTrack === null || screenTrack === void 0 || screenTrack.stopPreview(dom);
|
|
459
|
+
this._previewDom = null;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}, {
|
|
463
|
+
key: "stopRenderSharePreview",
|
|
464
|
+
value: function stopRenderSharePreview(targetScreenTrack) {
|
|
465
|
+
var screenTrack = targetScreenTrack !== null && targetScreenTrack !== void 0 ? targetScreenTrack : this.screenTrack;
|
|
466
|
+
this._previewDom && (screenTrack === null || screenTrack === void 0 ? void 0 : screenTrack.stopPreview(this._previewDom));
|
|
189
467
|
}
|
|
190
468
|
}, {
|
|
191
469
|
key: "_handleStreamPublic",
|
|
192
470
|
value: function _handleStreamPublic() {
|
|
193
|
-
var _this$_roomProvider$
|
|
194
|
-
var streams = (_this$_roomProvider$
|
|
471
|
+
var _this$_roomProvider$c3, _streams$find;
|
|
472
|
+
var streams = (_this$_roomProvider$c3 = this._roomProvider.currentRoomControl) === null || _this$_roomProvider$c3 === void 0 ? void 0 : _this$_roomProvider$c3.getStreamControl().getStreamList();
|
|
195
473
|
var isSharingScreen = streams === null || streams === void 0 ? void 0 : streams.some(function (stream) {
|
|
196
|
-
return stream.videoSourceType ===
|
|
474
|
+
return stream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN;
|
|
197
475
|
});
|
|
198
|
-
this.
|
|
199
|
-
|
|
200
|
-
return stream.videoSourceType ===
|
|
476
|
+
this._sharedScreenShareSharedDataSource.setIsSharingScreen(!!isSharingScreen);
|
|
477
|
+
var screenSharingOwner = streams === null || streams === void 0 || (_streams$find = streams.find(function (stream) {
|
|
478
|
+
return stream.videoSourceType === _type.AgoraRteVideoSourceType.SCREEN;
|
|
201
479
|
})) === null || _streams$find === void 0 ? void 0 : _streams$find.owner;
|
|
480
|
+
this._sharedScreenShareSharedDataSource.setScreenSharingOwner(screenSharingOwner);
|
|
481
|
+
}
|
|
482
|
+
}, {
|
|
483
|
+
key: "setScreenTrack",
|
|
484
|
+
value: function setScreenTrack(screenTrack) {
|
|
485
|
+
this._sharedScreenShareSharedDataSource.setScreenTrack(screenTrack);
|
|
202
486
|
}
|
|
203
487
|
}, {
|
|
204
488
|
key: "addObserver",
|
|
@@ -208,120 +492,224 @@ var FcrUIScreenShareProviderImpl = exports.FcrUIScreenShareProviderImpl = /*#__P
|
|
|
208
492
|
}, {
|
|
209
493
|
key: "removeObserver",
|
|
210
494
|
value: function removeObserver(observer) {
|
|
211
|
-
this._observable.removeObserver;
|
|
495
|
+
this._observable.removeObserver(observer);
|
|
212
496
|
}
|
|
213
497
|
}, {
|
|
214
498
|
key: "startShareWhiteboard",
|
|
215
499
|
value: function startShareWhiteboard() {
|
|
216
|
-
var _this$
|
|
217
|
-
(_this$
|
|
500
|
+
var _this$_sharingProvide;
|
|
501
|
+
(_this$_sharingProvide = this._sharingProvider) === null || _this$_sharingProvide === void 0 || _this$_sharingProvide.startWhiteboard();
|
|
218
502
|
}
|
|
219
503
|
}, {
|
|
220
504
|
key: "stopShareWhiteboard",
|
|
221
505
|
value: function stopShareWhiteboard() {
|
|
222
|
-
var _this$
|
|
223
|
-
(_this$
|
|
506
|
+
var _this$_sharingProvide2;
|
|
507
|
+
(_this$_sharingProvide2 = this._sharingProvider) === null || _this$_sharingProvide2 === void 0 || _this$_sharingProvide2.stop();
|
|
224
508
|
}
|
|
225
509
|
}, {
|
|
226
510
|
key: "release",
|
|
227
511
|
value: function release() {
|
|
228
|
-
var _this$
|
|
229
|
-
(_this$
|
|
512
|
+
var _this$_streamControl4;
|
|
513
|
+
(_this$_streamControl4 = this._streamControl) === null || _this$_streamControl4 === void 0 || _this$_streamControl4.removeObserver(this._streamObserver);
|
|
514
|
+
this._removeEventListeners();
|
|
230
515
|
}
|
|
231
516
|
}, {
|
|
232
517
|
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
|
-
|
|
518
|
+
value: function () {
|
|
519
|
+
var _startShareScreen = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(id, type, withAudio, isReplace) {
|
|
520
|
+
var _this$screenTrack4, _this$screenTrack5, streamId, screenTrack;
|
|
521
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
522
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
523
|
+
case 0:
|
|
524
|
+
_context4.prev = 0;
|
|
525
|
+
this.logger.info('screen-share-provider: enter startShareScreen');
|
|
526
|
+
if (!((0, _env.isElectron)() && !isReplace)) {
|
|
527
|
+
_context4.next = 7;
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
_context4.next = 5;
|
|
531
|
+
return this.createScreenShareWithSelectionId(id, this.currentSelectionBounds);
|
|
532
|
+
case 5:
|
|
533
|
+
streamId = _context4.sent;
|
|
534
|
+
if (streamId) {
|
|
535
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId(streamId);
|
|
536
|
+
}
|
|
537
|
+
case 7:
|
|
538
|
+
this._sharedScreenShareSharedDataSource.setShareWithAudio(withAudio);
|
|
539
|
+
this.toggleScreenshareWithAudio(withAudio);
|
|
540
|
+
screenTrack = this._deviceProvider.getScreenTrack(id);
|
|
541
|
+
this.setScreenTrack(screenTrack);
|
|
542
|
+
this.logger.info('screen-share-provider: start share screen with track start');
|
|
543
|
+
(_this$screenTrack4 = this.screenTrack) === null || _this$screenTrack4 === void 0 || _this$screenTrack4.addObserver(this._screenCaptureObserver);
|
|
544
|
+
_context4.t0 = (_this$screenTrack5 = this.screenTrack) === null || _this$screenTrack5 === void 0;
|
|
545
|
+
if (_context4.t0) {
|
|
546
|
+
_context4.next = 28;
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
_context4.t1 = _this$screenTrack5;
|
|
550
|
+
_context4.t2 = type;
|
|
551
|
+
_context4.t3 = withAudio;
|
|
552
|
+
if (!(0, _env.isElectron)()) {
|
|
553
|
+
_context4.next = 24;
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
_context4.next = 21;
|
|
557
|
+
return this._getExcludeWindows();
|
|
558
|
+
case 21:
|
|
559
|
+
_context4.t4 = _context4.sent;
|
|
560
|
+
_context4.next = 25;
|
|
561
|
+
break;
|
|
562
|
+
case 24:
|
|
563
|
+
_context4.t4 = undefined;
|
|
564
|
+
case 25:
|
|
565
|
+
_context4.t5 = _context4.t4;
|
|
566
|
+
_context4.t6 = {
|
|
567
|
+
withAudio: _context4.t3,
|
|
568
|
+
excludeWindows: _context4.t5
|
|
569
|
+
};
|
|
570
|
+
_context4.t1.start.call(_context4.t1, _context4.t2, _context4.t6);
|
|
571
|
+
case 28:
|
|
572
|
+
return _context4.abrupt("return", Promise.resolve(this.screenTrack));
|
|
573
|
+
case 31:
|
|
574
|
+
_context4.prev = 31;
|
|
575
|
+
_context4.t7 = _context4["catch"](0);
|
|
576
|
+
return _context4.abrupt("return", Promise.reject(_context4.t7));
|
|
577
|
+
case 34:
|
|
578
|
+
case "end":
|
|
579
|
+
return _context4.stop();
|
|
580
|
+
}
|
|
581
|
+
}, _callee4, this, [[0, 31]]);
|
|
582
|
+
}));
|
|
583
|
+
function startShareScreen(_x7, _x8, _x9, _x10) {
|
|
584
|
+
return _startShareScreen.apply(this, arguments);
|
|
254
585
|
}
|
|
255
|
-
|
|
586
|
+
return startShareScreen;
|
|
587
|
+
}()
|
|
256
588
|
}, {
|
|
257
589
|
key: "stopShareScreen",
|
|
258
|
-
value: function stopShareScreen() {
|
|
590
|
+
value: function stopShareScreen(targetScreenTrack) {
|
|
591
|
+
this.logger.info('screen-share-provider: stopShareScreen');
|
|
592
|
+
var screenTrack = targetScreenTrack !== null && targetScreenTrack !== void 0 ? targetScreenTrack : this.screenTrack;
|
|
593
|
+
this.setShareLock(false);
|
|
594
|
+
this.stopRenderSharePreview(screenTrack);
|
|
259
595
|
if ((0, _env.isElectron)()) {
|
|
260
|
-
this.
|
|
261
|
-
|
|
262
|
-
|
|
596
|
+
this._screenTrackStop();
|
|
597
|
+
this.removeScreenStream();
|
|
598
|
+
} else {
|
|
599
|
+
this.removeScreenStream();
|
|
600
|
+
this._screenTrackStop();
|
|
263
601
|
}
|
|
602
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareId('');
|
|
264
603
|
}
|
|
265
604
|
}, {
|
|
266
|
-
key: "
|
|
267
|
-
value: function
|
|
268
|
-
|
|
269
|
-
this.
|
|
270
|
-
this.
|
|
605
|
+
key: "_handleShareStartWithAudio",
|
|
606
|
+
value: function _handleShareStartWithAudio() {
|
|
607
|
+
var shareAudioTrack = this._deviceProvider.getLoopbackTrack(this.loopbackAudioSourceId);
|
|
608
|
+
this._sharedScreenShareSharedDataSource.setShareWithAudioTrack(shareAudioTrack);
|
|
609
|
+
if (this._deviceProvider.isCapabilitySupported(_fcrCore.FcrCapability.LOOPBACK_CAPTURE) && this.shareAudioTrack && this.shareAudioTrack.getState() === _fcrCore.FcrMediaSourceState.CLOSE) {
|
|
610
|
+
this.shareAudioTrack.start();
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}, {
|
|
614
|
+
key: "toggleScreenshareWithAudio",
|
|
615
|
+
value: function toggleScreenshareWithAudio(withAudio) {
|
|
616
|
+
this._sharedScreenShareSharedDataSource.setShareWithAudio(withAudio);
|
|
617
|
+
if (this.currentShareStreamId && this._streamControl) {
|
|
618
|
+
this._streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this.currentShareStreamId, {
|
|
619
|
+
audioPrivilege: withAudio ? _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
|
|
620
|
+
videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
|
|
621
|
+
}));
|
|
622
|
+
if (withAudio) {
|
|
623
|
+
this._handleShareStartWithAudio();
|
|
624
|
+
} else {
|
|
625
|
+
this._handleShareStopWithAudio();
|
|
626
|
+
}
|
|
627
|
+
}
|
|
271
628
|
}
|
|
272
|
-
|
|
273
|
-
// private _closeVideoWindowDialog() {
|
|
274
|
-
// // this._eventProvider.closeDialog(this._videoWindowDialogId);
|
|
275
|
-
// // this._videoWindowDialogId = '';
|
|
276
|
-
// this._eventProvider.sendEvent(FcrUIAction.CLOSE_VIDEO_WINDOW);
|
|
277
|
-
// }
|
|
278
629
|
}, {
|
|
279
|
-
key: "
|
|
630
|
+
key: "_getExcludeWindows",
|
|
280
631
|
value: function () {
|
|
281
|
-
var
|
|
282
|
-
var
|
|
283
|
-
return _regenerator["default"].wrap(function
|
|
284
|
-
while (1) switch (
|
|
632
|
+
var _getExcludeWindows2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
633
|
+
var excludeWindows;
|
|
634
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
635
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
285
636
|
case 0:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return
|
|
637
|
+
excludeWindows = [];
|
|
638
|
+
_context5.next = 3;
|
|
639
|
+
return (0, _tools.waitUntil)(function () {
|
|
640
|
+
var _getControlBarMediaSo, _getVideoWindowMediaS, _getAnnotationMediaSo, _getAnnotationMediaSo2;
|
|
641
|
+
var windowId = (_getControlBarMediaSo = (0, _rendererEvent.getControlBarMediaSourceId)()) !== null && _getControlBarMediaSo !== void 0 ? _getControlBarMediaSo : '';
|
|
642
|
+
var _windowId$split = windowId.split(':'),
|
|
643
|
+
_windowId$split2 = (0, _slicedToArray2["default"])(_windowId$split, 2),
|
|
644
|
+
videoWindowId = _windowId$split2[1];
|
|
645
|
+
if (videoWindowId && !excludeWindows.includes(videoWindowId)) {
|
|
646
|
+
excludeWindows.push(videoWindowId);
|
|
647
|
+
}
|
|
648
|
+
windowId = (_getVideoWindowMediaS = (0, _rendererEvent.getVideoWindowMediaSourceId)()) !== null && _getVideoWindowMediaS !== void 0 ? _getVideoWindowMediaS : '';
|
|
649
|
+
var _windowId$split3 = windowId.split(':'),
|
|
650
|
+
_windowId$split4 = (0, _slicedToArray2["default"])(_windowId$split3, 2),
|
|
651
|
+
controlBarWindowId = _windowId$split4[1];
|
|
652
|
+
if (controlBarWindowId && !excludeWindows.includes(controlBarWindowId)) {
|
|
653
|
+
excludeWindows.push(controlBarWindowId);
|
|
654
|
+
}
|
|
655
|
+
windowId = (_getAnnotationMediaSo = (0, _rendererEvent.getAnnotationMediaSourceId)('Annotation')) !== null && _getAnnotationMediaSo !== void 0 ? _getAnnotationMediaSo : '';
|
|
656
|
+
var _windowId$split5 = windowId.split(':'),
|
|
657
|
+
_windowId$split6 = (0, _slicedToArray2["default"])(_windowId$split5, 2),
|
|
658
|
+
annotationWindowId = _windowId$split6[1];
|
|
659
|
+
if (annotationWindowId && !excludeWindows.includes(annotationWindowId)) {
|
|
660
|
+
excludeWindows.push(annotationWindowId);
|
|
661
|
+
}
|
|
662
|
+
windowId = (_getAnnotationMediaSo2 = (0, _rendererEvent.getAnnotationMediaSourceId)('Annotation tool bar')) !== null && _getAnnotationMediaSo2 !== void 0 ? _getAnnotationMediaSo2 : '';
|
|
663
|
+
var _windowId$split7 = windowId.split(':'),
|
|
664
|
+
_windowId$split8 = (0, _slicedToArray2["default"])(_windowId$split7, 2),
|
|
665
|
+
annotationToolWindowId = _windowId$split8[1];
|
|
666
|
+
if (annotationToolWindowId && !excludeWindows.includes(annotationToolWindowId)) {
|
|
667
|
+
excludeWindows.push(annotationToolWindowId);
|
|
668
|
+
}
|
|
669
|
+
return !!videoWindowId && !!controlBarWindowId;
|
|
670
|
+
}, 'control bar is open');
|
|
289
671
|
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:
|
|
672
|
+
this.logger.info('exclude win:', JSON.stringify(excludeWindows));
|
|
673
|
+
return _context5.abrupt("return", excludeWindows);
|
|
674
|
+
case 5:
|
|
306
675
|
case "end":
|
|
307
|
-
return
|
|
676
|
+
return _context5.stop();
|
|
308
677
|
}
|
|
309
|
-
},
|
|
678
|
+
}, _callee5, this);
|
|
310
679
|
}));
|
|
311
|
-
function
|
|
312
|
-
return
|
|
680
|
+
function _getExcludeWindows() {
|
|
681
|
+
return _getExcludeWindows2.apply(this, arguments);
|
|
313
682
|
}
|
|
314
|
-
return
|
|
683
|
+
return _getExcludeWindows;
|
|
315
684
|
}()
|
|
685
|
+
}, {
|
|
686
|
+
key: "removeScreenStream",
|
|
687
|
+
value: function removeScreenStream() {
|
|
688
|
+
var streamId = this.currentShareStreamId;
|
|
689
|
+
if (!streamId) {
|
|
690
|
+
return false;
|
|
691
|
+
}
|
|
692
|
+
try {
|
|
693
|
+
var _this$_streamControl5;
|
|
694
|
+
this.logger.info('screen-share-provider: remove screen streams');
|
|
695
|
+
(_this$_streamControl5 = this._streamControl) === null || _this$_streamControl5 === void 0 || _this$_streamControl5.removeScreenStream();
|
|
696
|
+
this._sharedScreenShareSharedDataSource.setCurrentShareStreamId('');
|
|
697
|
+
return true;
|
|
698
|
+
} catch (error) {
|
|
699
|
+
this.logger.error('removeScreenStream error', error);
|
|
700
|
+
return false;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}, {
|
|
704
|
+
key: "_screenTrackStop",
|
|
705
|
+
value: function _screenTrackStop() {
|
|
706
|
+
var _this$screenTrack6;
|
|
707
|
+
this.logger.info('screen-share-provider: current screen track stop');
|
|
708
|
+
(_this$screenTrack6 = this.screenTrack) === null || _this$screenTrack6 === void 0 || _this$screenTrack6.stop();
|
|
709
|
+
}
|
|
316
710
|
}]);
|
|
317
711
|
}();
|
|
318
712
|
_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];
|
|
713
|
+
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"], [_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);
|
|
714
|
+
_initProto = _applyDecs$e[0];
|
|
327
715
|
(0, _base.registerDependency)('screenShareProvider');
|