fcr-ui-scene 3.7.3 → 3.7.4-rc.1
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 +2 -0
- package/lib/creator.js +14 -0
- package/lib/fragments/annotation/libs.d.ts +7 -6
- package/lib/fragments/annotation/libs.js +9 -8
- package/lib/fragments/whiteboard/store.js +13 -8
- package/lib/global.css +6 -0
- package/lib/modules/action-bar/components/screen-share/submenu.js +2 -2
- package/lib/modules/action-bar/index.d.ts +2 -0
- package/lib/modules/action-bar/index.js +2 -1
- package/lib/modules/action-bar/store.d.ts +6 -2
- package/lib/modules/action-bar/store.js +56 -93
- package/lib/modules/annotation/annotation-toolbar-store.js +2 -2
- package/lib/modules/annotation/store.js +12 -14
- package/lib/modules/audio-stream/index.js +1 -2
- package/lib/modules/chat/components/chat-select/index.js +3 -0
- package/lib/modules/components/device-control/store.js +2 -2
- package/lib/modules/components/leave-meeting/index.js +4 -1
- package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.d.ts +6 -4
- package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.js +77 -41
- package/lib/modules/components/member-window/components/video-player/components/remote-video-player-with-zoom.d.ts +3 -3
- package/lib/modules/components/member-window/components/video-player/index.d.ts +3 -3
- package/lib/modules/components/member-window/types.d.ts +3 -3
- package/lib/modules/control-bar/store.d.ts +10 -8
- package/lib/modules/control-bar/store.js +47 -15
- package/lib/modules/control-bar/view.js +27 -13
- package/lib/modules/device-pretest/store.js +4 -2
- package/lib/modules/dialog/components/dialog-container/component/body.js +3 -24
- package/lib/modules/dialog/components/dialog-container/index.d.ts +4 -0
- package/lib/modules/dialog/components/dialog-container/index.js +67 -44
- package/lib/modules/dialog/components/normal-window/index.js +4 -0
- package/lib/modules/dialog/dialogs/control-bar/index.js +9 -32
- package/lib/modules/dialog/dialogs/sub-window/index.js +4 -0
- package/lib/modules/dialog/dialogs/video-window/index.js +28 -23
- package/lib/modules/dialog/hooks/useElectron.js +4 -1
- package/lib/modules/dialog/level-config.js +1 -1
- package/lib/modules/dialog/store.d.ts +4 -3
- package/lib/modules/dialog/store.js +14 -10
- package/lib/modules/event-confirm/components/window/index.d.ts +5 -2
- package/lib/modules/event-confirm/components/window/index.js +38 -14
- package/lib/modules/event-confirm/index.css +0 -2
- package/lib/modules/event-confirm/store.d.ts +10 -5
- package/lib/modules/event-confirm/store.js +62 -13
- package/lib/modules/event-confirm/view.js +9 -7
- package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +1 -2
- package/lib/modules/interpreter/store.js +11 -13
- package/lib/modules/layout/components/CommonVideoRenderer.js +5 -5
- package/lib/modules/layout/store.js +8 -22
- package/lib/modules/participant/member-list-data-source.js +3 -5
- package/lib/modules/participant/store.js +43 -43
- package/lib/modules/secondary-window/index.d.ts +2 -1
- package/lib/modules/secondary-window/index.js +5 -0
- package/lib/modules/secondary-window/type.d.ts +13 -9
- package/lib/modules/secondary-window/view.js +12 -12
- package/lib/modules/setting/audio-settings/audio-settings.js +4 -2
- package/lib/modules/setting/config.d.ts +4 -0
- package/lib/modules/setting/config.js +6 -3
- package/lib/modules/setting/store.d.ts +8 -3
- package/lib/modules/setting/store.js +104 -74
- package/lib/modules/setting/view.js +3 -2
- package/lib/modules/share-screen/components/selection/index.js +6 -8
- package/lib/modules/share-screen/store.d.ts +9 -10
- package/lib/modules/share-screen/store.js +65 -90
- package/lib/modules/share-screen/types.d.ts +7 -8
- package/lib/modules/video-window/components/members/index.js +3 -3
- package/lib/modules/video-window/store.js +3 -3
- package/lib/modules/whiteboard/components/control-bar/store.d.ts +3 -0
- package/lib/modules/whiteboard/components/control-bar/store.js +20 -11
- package/lib/modules/whiteboard/components/toolbar/store.js +2 -2
- package/lib/modules/whiteboard/index.d.ts +10 -4
- package/lib/modules/whiteboard/index.js +158 -124
- package/lib/plugins/module-dev-plugin.js +4 -0
- package/lib/providers/annotation-provider.js +3 -3
- package/lib/providers/device-privilege-provider.js +13 -12
- package/lib/providers/device-provider.d.ts +37 -31
- package/lib/providers/device-provider.js +692 -746
- package/lib/providers/device-stream-provider.js +4 -4
- package/lib/providers/interpreter-provider.js +7 -9
- package/lib/providers/multi-display-provider.d.ts +8 -3
- package/lib/providers/multi-display-provider.js +18 -6
- package/lib/providers/privilege-provider.d.ts +3 -11
- package/lib/providers/privilege-provider.js +2 -5
- package/lib/providers/renderer-provider.d.ts +3 -3
- package/lib/providers/renderer-provider.js +20 -32
- package/lib/providers/room-provider.js +14 -15
- package/lib/providers/screen-share-provider.d.ts +12 -10
- package/lib/providers/screen-share-provider.js +79 -59
- package/lib/providers/sharing-provider.js +7 -0
- package/lib/providers/whiteboard-provider.js +1 -0
- package/lib/scenes/main-scene.js +15 -9
- package/lib/schema.d.ts +3 -3
- package/lib/schema.js +1 -1
- package/lib/shared-data-source/confirm-data.d.ts +19 -0
- package/lib/shared-data-source/confirm-data.js +119 -15
- package/lib/shared-data-source/screen-share-data.d.ts +29 -28
- package/lib/shared-data-source/screen-share-data.js +14 -8
- package/lib/shared-data-source/setting.js +2 -2
- package/lib/shared-data-source/whiteboard-data.d.ts +7 -5
- package/lib/shared-data-source/whiteboard-data.js +9 -8
- package/lib/ui-scene.d.ts +2 -0
- package/lib/ui-scene.js +77 -21
- package/lib/utilities/constant.d.ts +5 -0
- package/lib/utilities/constant.js +7 -2
- package/lib/utilities/default-config.d.ts +4 -0
- package/lib/utilities/default-config.js +8 -4
- package/lib/utilities/dialog-utils.d.ts +3 -2
- package/lib/utilities/dialog-utils.js +33 -14
- package/lib/utilities/package-info.d.ts +3 -0
- package/lib/utilities/package-info.js +15 -0
- package/lib/waiting-room-control-manager.js +6 -6
- package/package.json +6 -6
- package/public/index.html +5 -0
|
@@ -28,6 +28,7 @@ require("core-js/modules/es.array.for-each.js");
|
|
|
28
28
|
require("core-js/modules/es.array.iterator.js");
|
|
29
29
|
require("core-js/modules/es.array.map.js");
|
|
30
30
|
require("core-js/modules/es.array.push.js");
|
|
31
|
+
require("core-js/modules/es.array.reduce.js");
|
|
31
32
|
require("core-js/modules/es.array.slice.js");
|
|
32
33
|
require("core-js/modules/es.array.some.js");
|
|
33
34
|
require("core-js/modules/es.array.sort.js");
|
|
@@ -38,7 +39,6 @@ require("core-js/modules/es.object.assign.js");
|
|
|
38
39
|
require("core-js/modules/es.object.to-string.js");
|
|
39
40
|
require("core-js/modules/es.promise.js");
|
|
40
41
|
require("core-js/modules/es.promise.all-settled.js");
|
|
41
|
-
require("core-js/modules/es.promise.finally.js");
|
|
42
42
|
require("core-js/modules/es.regexp.exec.js");
|
|
43
43
|
require("core-js/modules/es.set.js");
|
|
44
44
|
require("core-js/modules/es.string.iterator.js");
|
|
@@ -48,6 +48,7 @@ require("core-js/modules/esnext.iterator.filter.js");
|
|
|
48
48
|
require("core-js/modules/esnext.iterator.find.js");
|
|
49
49
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
50
50
|
require("core-js/modules/esnext.iterator.map.js");
|
|
51
|
+
require("core-js/modules/esnext.iterator.reduce.js");
|
|
51
52
|
require("core-js/modules/esnext.iterator.some.js");
|
|
52
53
|
require("core-js/modules/esnext.map.delete-all.js");
|
|
53
54
|
require("core-js/modules/esnext.map.emplace.js");
|
|
@@ -106,7 +107,7 @@ var _imports = require("fcr-core/lib/imports");
|
|
|
106
107
|
var _base = require("../base");
|
|
107
108
|
var _env = require("agora-foundation/lib/utilities/env");
|
|
108
109
|
var _fcrCore = require("fcr-core");
|
|
109
|
-
var _type = require("
|
|
110
|
+
var _type = require("fcr-core/lib/type");
|
|
110
111
|
var _localVideoPlayer = require("agora-ui-foundation/lib/components/local-video-player");
|
|
111
112
|
var _i18n = require("agora-ui-foundation/lib/i18n");
|
|
112
113
|
var _mobx = require("mobx");
|
|
@@ -115,7 +116,7 @@ var _type2 = require("../type");
|
|
|
115
116
|
var _tools = require("../utilities/tools");
|
|
116
117
|
var _logger = require("../utilities/logger");
|
|
117
118
|
var _FcrUIDeviceProviderImpl;
|
|
118
|
-
var _initProto,
|
|
119
|
+
var _initProto, _init__microphoneDevice, _init__microphone, _init__speakerDevice, _init__speaker, _init__cameraDevice, _init_currentIsMirror, _init_showForceOpenEffectDialog, _init_cameraEnabled, _init_showCameraPreview, _init_microphoneEnabled, _init_cameraList, _init_microphoneList, _init_microphoneVolumeLevel, _init_speakerList, _init_isLocalMirrorEnabled, _init_isLocalEditBeautyOptions, _init_speakerVolumeLevel, _init_speakerVolume, _init_microphoneVolume, _init_virtualBackgroundName, _init_enableBeauty, _init_beautyKey, _init_beautyOptions, _init_virtualBackgroundList, _init_soundEffectList, _init_microphoneDetecting, _init_speakerDetecting, _init_connectType, _init_isMainRoomAudioOff, _startPlayLocalVideoDecs, _stopPlayLocalVideoDecs, _startSpeakerTestDecs, _stopSpeakerTestDecs, _setCurrentIsMirrorDecs, _toggleLocalMirrorPreviewDecs, _setBeautyOptionsDecs, _handleCancelForceOpenVideoEffectDecs, _handleForceOpenVideoEffectDecs, _setCameraEnabledDecs, _handleCameraEnabledChangedDecs, _setMicrophoneEnabledDecs, _toggleLocalMirrorDecs, _resetMirrorDecs, _startMicrophoneTestDecs, _stopMicrophoneTestDecs, _enableVirtualBackgroundDecs, _setEditBeautyKeyDecs, _enableBeautyEffectDecs, _setCameraIdDecs, _setMainRoomAudioOffDecs, _setSpeakerIdDecs, _setMicrophoneIdDecs, _setSpeakerVolumeDecs, _setMicrophoneVolumeDecs, _startOrStopCameraDecs, _setShowCameraPreviewDecs, _loadUiResourcesDecs, _loadZipResourcesDecs, _setConnectTypeDecs, _toggleLocalCameraPreviewDecs, _getLoopbackDeviceIdDecs, _initDeviceListDecs, _handleMicrophoneAudioTrackDecs, _handleMicrophoneEnabledChangedDecs, _handleCameraVideoTrackDecs, _handleSpeakerDetectingChangedDecs, _stopSelectedSpeakerTestDecs, _handleMicrophoneDetectingChangedDecs, _stopMicrophoneTestDecs2, _updateVirtualBackgroundListDecs, _handleSystemSelectedSpeakerChangedDecs, _handleSystemSelectedMicrophoneChangedDecs, _correctSystemSelectedMicrophoneDeviceIdDecs, _handleSelectedSpeakerVolumeUpdatedDecs, _handleSpeakerTestVolumeIndicationUpdatedDecs, _handleMicrophoneVolumeIndicationUpdatedDecs, _handleSpeakerAddedDecs, _handleSpeakerRemovedDecs, _handleSpeakerListUpdatedDecs, _getMicrophoneListDecs, _getSpeakerListDecs, _formatDeviceListDecs, _loadBuiltinResourcesDecs, _ref;
|
|
119
120
|
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
|
|
120
121
|
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
|
|
121
122
|
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
|
@@ -128,6 +129,9 @@ function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.descr
|
|
|
128
129
|
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; }
|
|
129
130
|
// device id for default device (follow system)
|
|
130
131
|
var DEFAULT_DEVICE_ID = exports.DEFAULT_DEVICE_ID = 'default';
|
|
132
|
+
var getDeviceVolumeLevel = function getDeviceVolumeLevel(volume) {
|
|
133
|
+
return Math.floor(volume / 255 * 100);
|
|
134
|
+
};
|
|
131
135
|
var _A = /*#__PURE__*/new WeakMap();
|
|
132
136
|
var _B = /*#__PURE__*/new WeakMap();
|
|
133
137
|
var _C = /*#__PURE__*/new WeakMap();
|
|
@@ -157,8 +161,7 @@ var _Z = /*#__PURE__*/new WeakMap();
|
|
|
157
161
|
var _a = /*#__PURE__*/new WeakMap();
|
|
158
162
|
var _b = /*#__PURE__*/new WeakMap();
|
|
159
163
|
var _c = /*#__PURE__*/new WeakMap();
|
|
160
|
-
|
|
161
|
-
_ref = (_initDefaultDeviceDecs = [_mobx.action, _mobx.action.bound], _initDeviceListDecs = [_mobx.action, _mobx.action.bound], _startPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _stopPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _startSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _stopSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _setCurrentIsMirrorDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorPreviewDecs = [_mobx.action, _mobx.action.bound], _setBeautyOptionsDecs = [_mobx.action, _mobx.action.bound], _handleCancelForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _handleForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraEnabledDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneAudioTrackDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneEnabledDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneEnabledChangedDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorDecs = [_mobx.action, _mobx.action.bound], _resetMirrorDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _startMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _stopMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _enableVirtualBackgroundDecs = [_mobx.action, _mobx.action.bound], _setEditBeautyKeyDecs = [_mobx.action, _mobx.action.bound], _enableBeautyEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraIdDecs = [_mobx.action, _mobx.action.bound], _setSpeakerIdDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _setSpeakerVolumeDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneVolumeDecs = [_mobx.action, _mobx.action.bound], _loadUiResourcesDecs = [_mobx.action, _mobx.action.bound], _setConnectTypeDecs = [_mobx.action, _mobx.action.bound], _updateVirtualBackgroundListDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedSpeakerChangedDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedMicrophoneChangedDecs = [_mobx.action, _mobx.action.bound], _correctSystemSelectedMicrophoneDeviceIdDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerTestVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerVolumeUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerAddedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerRemovedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerListUpdatedDecs = [_mobx.action, _mobx.action.bound], _setMainRoomAudioOffDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
164
|
+
_ref = (_startPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _stopPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _startSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _stopSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _setCurrentIsMirrorDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorPreviewDecs = [_mobx.action, _mobx.action.bound], _setBeautyOptionsDecs = [_mobx.action, _mobx.action.bound], _handleCancelForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _handleForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraEnabledDecs = [_mobx.action, _mobx.action.bound], _handleCameraEnabledChangedDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneEnabledDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorDecs = [_mobx.action, _mobx.action.bound], _resetMirrorDecs = [_mobx.action, _mobx.action.bound], _startMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _stopMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _enableVirtualBackgroundDecs = [_mobx.action, _mobx.action.bound], _setEditBeautyKeyDecs = [_mobx.action, _mobx.action.bound], _enableBeautyEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraIdDecs = [_mobx.action, _mobx.action.bound], _setMainRoomAudioOffDecs = [_mobx.action, _mobx.action.bound], _setSpeakerIdDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _setSpeakerVolumeDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneVolumeDecs = [_mobx.action, _mobx.action.bound], _startOrStopCameraDecs = [_mobx.action, _mobx.action.bound], _setShowCameraPreviewDecs = [_mobx.action, _mobx.action.bound], _loadUiResourcesDecs = [_mobx.action, _mobx.action.bound], _loadZipResourcesDecs = [_mobx.action, _mobx.action.bound], _setConnectTypeDecs = [_mobx.action, _mobx.action.bound], _toggleLocalCameraPreviewDecs = [_mobx.action, _mobx.action.bound], _getLoopbackDeviceIdDecs = [_mobx.action, _mobx.action.bound], _initDeviceListDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneAudioTrackDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneEnabledChangedDecs = [_mobx.action, _mobx.action.bound], _handleCameraVideoTrackDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _stopSelectedSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _stopMicrophoneTestDecs2 = [_mobx.action, _mobx.action.bound], _updateVirtualBackgroundListDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedSpeakerChangedDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedMicrophoneChangedDecs = [_mobx.action, _mobx.action.bound], _correctSystemSelectedMicrophoneDeviceIdDecs = [_mobx.action, _mobx.action.bound], _handleSelectedSpeakerVolumeUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerTestVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerAddedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerRemovedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerListUpdatedDecs = [_mobx.action, _mobx.action.bound], _getMicrophoneListDecs = [_mobx.action, _mobx.action.bound], _getSpeakerListDecs = [_mobx.action, _mobx.action.bound], _formatDeviceListDecs = [_mobx.action, _mobx.action.bound], _loadBuiltinResourcesDecs = [_mobx.action, _mobx.action.bound], "logger");
|
|
162
165
|
var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/function () {
|
|
163
166
|
function FcrUIDeviceProviderImpl(_eventProvider, _mediaControl, _sharedSettingDataSource) {
|
|
164
167
|
var _this = this;
|
|
@@ -171,9 +174,10 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
171
174
|
(0, _defineProperty2["default"])(this, "_hasExecutedOpenCamera", false);
|
|
172
175
|
(0, _defineProperty2["default"])(this, "_hasExecutedConnectAudio", false);
|
|
173
176
|
(0, _defineProperty2["default"])(this, "_isAudioConnected", false);
|
|
177
|
+
(0, _defineProperty2["default"])(this, "_cameraVideoTrack", null);
|
|
174
178
|
(0, _defineProperty2["default"])(this, "_microphoneAudioTrack", null);
|
|
175
179
|
(0, _defineProperty2["default"])(this, "_localVideoViewSet", new Set());
|
|
176
|
-
(0, _defineProperty2["default"])(this, "_videoRotation", _type.
|
|
180
|
+
(0, _defineProperty2["default"])(this, "_videoRotation", _type.FcrVideoOrientation.VIDEO_ORIENTATION_0);
|
|
177
181
|
(0, _defineProperty2["default"])(this, "_released", false);
|
|
178
182
|
// 强制开启美颜
|
|
179
183
|
(0, _defineProperty2["default"])(this, "_isForceEnableBeauty", false);
|
|
@@ -186,78 +190,74 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
186
190
|
onVolumeIndicationUpdated: this._handleMicrophoneVolumeIndicationUpdated
|
|
187
191
|
});
|
|
188
192
|
(0, _defineProperty2["default"])(this, "_mediaControlObserver", {
|
|
189
|
-
onCameraAdded: this.
|
|
190
|
-
onCameraRemoved: this.
|
|
193
|
+
onCameraAdded: this._handleCameraAdded,
|
|
194
|
+
onCameraRemoved: this._handleCameraRemoved,
|
|
191
195
|
onMicrophoneAdded: this._handleMicrophoneAdded,
|
|
192
196
|
onMicrophoneRemoved: this._handleMicrophoneRemoved,
|
|
193
197
|
onSpeakerAdded: this._handleSpeakerAdded,
|
|
194
198
|
onSpeakerRemoved: this._handleSpeakerRemoved,
|
|
195
199
|
onSpeakerTestVolumeIndicationUpdated: this._handleSpeakerTestVolumeIndicationUpdated,
|
|
196
|
-
onSelectedSpeakerVolumeUpdated: this.
|
|
200
|
+
onSelectedSpeakerVolumeUpdated: this._handleSelectedSpeakerVolumeUpdated,
|
|
197
201
|
onSystemSelectedSpeakerChanged: this._handleSystemSelectedSpeakerChanged,
|
|
198
202
|
onSystemSelectedMicrophoneChanged: this._handleSystemSelectedMicrophoneChanged
|
|
199
203
|
});
|
|
200
204
|
(0, _defineProperty2["default"])(this, "_defaultMirror", true);
|
|
201
205
|
(0, _defineProperty2["default"])(this, "_volumeIndicationInterval", 200);
|
|
202
|
-
_classPrivateFieldInitSpec(this, _A,
|
|
203
|
-
// real microphone device id
|
|
204
|
-
_classPrivateFieldInitSpec(this, _B, _init__microphoneDevice(this, {
|
|
206
|
+
_classPrivateFieldInitSpec(this, _A, _init__microphoneDevice(this, {
|
|
205
207
|
id: null
|
|
206
208
|
}));
|
|
207
|
-
_classPrivateFieldInitSpec(this,
|
|
209
|
+
_classPrivateFieldInitSpec(this, _B, _init__microphone(this, {
|
|
208
210
|
id: DEFAULT_DEVICE_ID
|
|
209
211
|
}));
|
|
210
|
-
|
|
211
|
-
// @observable private accessor _speakerDeviceId = '';
|
|
212
|
-
_classPrivateFieldInitSpec(this, _D, _init__speakerDevice(this, {
|
|
212
|
+
_classPrivateFieldInitSpec(this, _C, _init__speakerDevice(this, {
|
|
213
213
|
id: null
|
|
214
214
|
}));
|
|
215
|
-
_classPrivateFieldInitSpec(this,
|
|
215
|
+
_classPrivateFieldInitSpec(this, _D, _init__speaker(this, {
|
|
216
216
|
id: DEFAULT_DEVICE_ID
|
|
217
217
|
}));
|
|
218
|
+
_classPrivateFieldInitSpec(this, _E, _init__cameraDevice(this, {
|
|
219
|
+
id: null
|
|
220
|
+
}));
|
|
218
221
|
// 是否开启镜像
|
|
219
222
|
_classPrivateFieldInitSpec(this, _F, _init_currentIsMirror(this, true));
|
|
220
223
|
// 是否展示展示强制开启特效弹窗
|
|
221
224
|
_classPrivateFieldInitSpec(this, _G, _init_showForceOpenEffectDialog(this, false));
|
|
222
|
-
|
|
223
|
-
_classPrivateFieldInitSpec(this,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
_classPrivateFieldInitSpec(this,
|
|
228
|
-
_classPrivateFieldInitSpec(this,
|
|
229
|
-
_classPrivateFieldInitSpec(this,
|
|
230
|
-
_classPrivateFieldInitSpec(this,
|
|
231
|
-
_classPrivateFieldInitSpec(this,
|
|
232
|
-
_classPrivateFieldInitSpec(this,
|
|
233
|
-
_classPrivateFieldInitSpec(this,
|
|
234
|
-
_classPrivateFieldInitSpec(this,
|
|
235
|
-
_classPrivateFieldInitSpec(this,
|
|
236
|
-
_classPrivateFieldInitSpec(this,
|
|
237
|
-
_classPrivateFieldInitSpec(this,
|
|
238
|
-
_classPrivateFieldInitSpec(this, _T, _init_microphoneVolume(this, 100));
|
|
239
|
-
_classPrivateFieldInitSpec(this, _U, _init_virtualBackgroundName(this, 'None'));
|
|
240
|
-
_classPrivateFieldInitSpec(this, _V, _init_enableBeauty(this, false));
|
|
241
|
-
_classPrivateFieldInitSpec(this, _W, _init_beautyKey(this, 'none'));
|
|
242
|
-
_classPrivateFieldInitSpec(this, _X, _init_beautyOptions(this, {
|
|
225
|
+
_classPrivateFieldInitSpec(this, _H, _init_cameraEnabled(this, false));
|
|
226
|
+
_classPrivateFieldInitSpec(this, _I, _init_showCameraPreview(this, false));
|
|
227
|
+
_classPrivateFieldInitSpec(this, _J, _init_microphoneEnabled(this, false));
|
|
228
|
+
_classPrivateFieldInitSpec(this, _K, _init_cameraList(this, []));
|
|
229
|
+
_classPrivateFieldInitSpec(this, _L, _init_microphoneList(this, []));
|
|
230
|
+
_classPrivateFieldInitSpec(this, _M, _init_microphoneVolumeLevel(this, 0));
|
|
231
|
+
_classPrivateFieldInitSpec(this, _N, _init_speakerList(this, []));
|
|
232
|
+
_classPrivateFieldInitSpec(this, _O, _init_isLocalMirrorEnabled(this, false));
|
|
233
|
+
_classPrivateFieldInitSpec(this, _P, _init_isLocalEditBeautyOptions(this, false));
|
|
234
|
+
_classPrivateFieldInitSpec(this, _Q, _init_speakerVolumeLevel(this, 0));
|
|
235
|
+
_classPrivateFieldInitSpec(this, _R, _init_speakerVolume(this, 0));
|
|
236
|
+
_classPrivateFieldInitSpec(this, _S, _init_microphoneVolume(this, 100));
|
|
237
|
+
_classPrivateFieldInitSpec(this, _T, _init_virtualBackgroundName(this, 'None'));
|
|
238
|
+
_classPrivateFieldInitSpec(this, _U, _init_enableBeauty(this, false));
|
|
239
|
+
_classPrivateFieldInitSpec(this, _V, _init_beautyKey(this, 'none'));
|
|
240
|
+
_classPrivateFieldInitSpec(this, _W, _init_beautyOptions(this, {
|
|
243
241
|
lighteningContrastLevel: 0,
|
|
244
242
|
lighteningLevel: _localVideoPlayer.DEFAULT_BEAUTY_VALUE,
|
|
245
243
|
smoothnessLevel: _localVideoPlayer.DEFAULT_BEAUTY_VALUE,
|
|
246
244
|
sharpnessLevel: _localVideoPlayer.DEFAULT_BEAUTY_VALUE,
|
|
247
245
|
rednessLevel: _localVideoPlayer.DEFAULT_BEAUTY_VALUE
|
|
248
246
|
}));
|
|
249
|
-
_classPrivateFieldInitSpec(this,
|
|
250
|
-
_classPrivateFieldInitSpec(this,
|
|
251
|
-
_classPrivateFieldInitSpec(this,
|
|
252
|
-
_classPrivateFieldInitSpec(this,
|
|
253
|
-
_classPrivateFieldInitSpec(this,
|
|
254
|
-
_classPrivateFieldInitSpec(this,
|
|
247
|
+
_classPrivateFieldInitSpec(this, _X, _init_virtualBackgroundList(this, []));
|
|
248
|
+
_classPrivateFieldInitSpec(this, _Y, _init_soundEffectList(this, new Map()));
|
|
249
|
+
_classPrivateFieldInitSpec(this, _Z, _init_microphoneDetecting(this, false));
|
|
250
|
+
_classPrivateFieldInitSpec(this, _a, _init_speakerDetecting(this, false));
|
|
251
|
+
_classPrivateFieldInitSpec(this, _b, _init_connectType(this, _type2.FcrUIConnectType.NONE));
|
|
252
|
+
_classPrivateFieldInitSpec(this, _c, _init_isMainRoomAudioOff(this, false));
|
|
255
253
|
this._eventProvider = _eventProvider;
|
|
256
254
|
this._mediaControl = _mediaControl;
|
|
257
255
|
this._sharedSettingDataSource = _sharedSettingDataSource;
|
|
258
256
|
this._disposer.push((0, _mobx.reaction)(function () {
|
|
259
|
-
return _this.
|
|
260
|
-
}, this.
|
|
257
|
+
return _this.cameraEnabled;
|
|
258
|
+
}, this._handleCameraEnabledChanged), (0, _mobx.reaction)(function () {
|
|
259
|
+
return _this._cameraDevice;
|
|
260
|
+
}, this._handleCameraDeviceIdChanged), (0, _mobx.reaction)(function () {
|
|
261
261
|
return _this.microphoneEnabled;
|
|
262
262
|
}, this._handleMicrophoneEnabledChanged), (0, _mobx.reaction)(function () {
|
|
263
263
|
return _this._microphone;
|
|
@@ -271,9 +271,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
271
271
|
return _this.speakerDetecting;
|
|
272
272
|
}, this._handleSpeakerDetectingChanged), (0, _mobx.reaction)(function () {
|
|
273
273
|
return _this.microphoneDetecting;
|
|
274
|
-
}, this._handleMicrophoneDetectingChanged)
|
|
275
|
-
return _this._isDeviceListInited;
|
|
276
|
-
}, this._initDefaultDevice));
|
|
274
|
+
}, this._handleMicrophoneDetectingChanged));
|
|
277
275
|
this._mediaControl.addObserver(this._mediaControlObserver);
|
|
278
276
|
this._initDeviceList();
|
|
279
277
|
(0, _mobx.runInAction)(function () {
|
|
@@ -281,7 +279,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
281
279
|
});
|
|
282
280
|
}
|
|
283
281
|
return (0, _createClass2["default"])(FcrUIDeviceProviderImpl, [{
|
|
284
|
-
key: "
|
|
282
|
+
key: "_microphoneDevice",
|
|
285
283
|
get: function get() {
|
|
286
284
|
return _classPrivateFieldGet(_A, this);
|
|
287
285
|
},
|
|
@@ -289,7 +287,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
289
287
|
_classPrivateFieldSet(_A, this, v);
|
|
290
288
|
}
|
|
291
289
|
}, {
|
|
292
|
-
key: "
|
|
290
|
+
key: "_microphone",
|
|
293
291
|
get: function get() {
|
|
294
292
|
return _classPrivateFieldGet(_B, this);
|
|
295
293
|
},
|
|
@@ -297,7 +295,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
297
295
|
_classPrivateFieldSet(_B, this, v);
|
|
298
296
|
}
|
|
299
297
|
}, {
|
|
300
|
-
key: "
|
|
298
|
+
key: "_speakerDevice",
|
|
301
299
|
get: function get() {
|
|
302
300
|
return _classPrivateFieldGet(_C, this);
|
|
303
301
|
},
|
|
@@ -305,7 +303,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
305
303
|
_classPrivateFieldSet(_C, this, v);
|
|
306
304
|
}
|
|
307
305
|
}, {
|
|
308
|
-
key: "
|
|
306
|
+
key: "_speaker",
|
|
309
307
|
get: function get() {
|
|
310
308
|
return _classPrivateFieldGet(_D, this);
|
|
311
309
|
},
|
|
@@ -313,7 +311,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
313
311
|
_classPrivateFieldSet(_D, this, v);
|
|
314
312
|
}
|
|
315
313
|
}, {
|
|
316
|
-
key: "
|
|
314
|
+
key: "_cameraDevice",
|
|
317
315
|
get: function get() {
|
|
318
316
|
return _classPrivateFieldGet(_E, this);
|
|
319
317
|
},
|
|
@@ -337,7 +335,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
337
335
|
_classPrivateFieldSet(_G, this, v);
|
|
338
336
|
}
|
|
339
337
|
}, {
|
|
340
|
-
key: "
|
|
338
|
+
key: "cameraEnabled",
|
|
341
339
|
get: function get() {
|
|
342
340
|
return _classPrivateFieldGet(_H, this);
|
|
343
341
|
},
|
|
@@ -345,7 +343,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
345
343
|
_classPrivateFieldSet(_H, this, v);
|
|
346
344
|
}
|
|
347
345
|
}, {
|
|
348
|
-
key: "
|
|
346
|
+
key: "showCameraPreview",
|
|
349
347
|
get: function get() {
|
|
350
348
|
return _classPrivateFieldGet(_I, this);
|
|
351
349
|
},
|
|
@@ -353,7 +351,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
353
351
|
_classPrivateFieldSet(_I, this, v);
|
|
354
352
|
}
|
|
355
353
|
}, {
|
|
356
|
-
key: "
|
|
354
|
+
key: "microphoneEnabled",
|
|
357
355
|
get: function get() {
|
|
358
356
|
return _classPrivateFieldGet(_J, this);
|
|
359
357
|
},
|
|
@@ -361,7 +359,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
361
359
|
_classPrivateFieldSet(_J, this, v);
|
|
362
360
|
}
|
|
363
361
|
}, {
|
|
364
|
-
key: "
|
|
362
|
+
key: "cameraList",
|
|
365
363
|
get: function get() {
|
|
366
364
|
return _classPrivateFieldGet(_K, this);
|
|
367
365
|
},
|
|
@@ -369,7 +367,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
369
367
|
_classPrivateFieldSet(_K, this, v);
|
|
370
368
|
}
|
|
371
369
|
}, {
|
|
372
|
-
key: "
|
|
370
|
+
key: "microphoneList",
|
|
373
371
|
get: function get() {
|
|
374
372
|
return _classPrivateFieldGet(_L, this);
|
|
375
373
|
},
|
|
@@ -377,7 +375,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
377
375
|
_classPrivateFieldSet(_L, this, v);
|
|
378
376
|
}
|
|
379
377
|
}, {
|
|
380
|
-
key: "
|
|
378
|
+
key: "microphoneVolumeLevel",
|
|
381
379
|
get: function get() {
|
|
382
380
|
return _classPrivateFieldGet(_M, this);
|
|
383
381
|
},
|
|
@@ -385,7 +383,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
385
383
|
_classPrivateFieldSet(_M, this, v);
|
|
386
384
|
}
|
|
387
385
|
}, {
|
|
388
|
-
key: "
|
|
386
|
+
key: "speakerList",
|
|
389
387
|
get: function get() {
|
|
390
388
|
return _classPrivateFieldGet(_N, this);
|
|
391
389
|
},
|
|
@@ -393,7 +391,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
393
391
|
_classPrivateFieldSet(_N, this, v);
|
|
394
392
|
}
|
|
395
393
|
}, {
|
|
396
|
-
key: "
|
|
394
|
+
key: "isLocalMirrorEnabled",
|
|
397
395
|
get: function get() {
|
|
398
396
|
return _classPrivateFieldGet(_O, this);
|
|
399
397
|
},
|
|
@@ -401,7 +399,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
401
399
|
_classPrivateFieldSet(_O, this, v);
|
|
402
400
|
}
|
|
403
401
|
}, {
|
|
404
|
-
key: "
|
|
402
|
+
key: "isLocalEditBeautyOptions",
|
|
405
403
|
get: function get() {
|
|
406
404
|
return _classPrivateFieldGet(_P, this);
|
|
407
405
|
},
|
|
@@ -409,7 +407,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
409
407
|
_classPrivateFieldSet(_P, this, v);
|
|
410
408
|
}
|
|
411
409
|
}, {
|
|
412
|
-
key: "
|
|
410
|
+
key: "speakerVolumeLevel",
|
|
413
411
|
get: function get() {
|
|
414
412
|
return _classPrivateFieldGet(_Q, this);
|
|
415
413
|
},
|
|
@@ -417,7 +415,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
417
415
|
_classPrivateFieldSet(_Q, this, v);
|
|
418
416
|
}
|
|
419
417
|
}, {
|
|
420
|
-
key: "
|
|
418
|
+
key: "speakerVolume",
|
|
421
419
|
get: function get() {
|
|
422
420
|
return _classPrivateFieldGet(_R, this);
|
|
423
421
|
},
|
|
@@ -425,7 +423,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
425
423
|
_classPrivateFieldSet(_R, this, v);
|
|
426
424
|
}
|
|
427
425
|
}, {
|
|
428
|
-
key: "
|
|
426
|
+
key: "microphoneVolume",
|
|
429
427
|
get: function get() {
|
|
430
428
|
return _classPrivateFieldGet(_S, this);
|
|
431
429
|
},
|
|
@@ -433,7 +431,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
433
431
|
_classPrivateFieldSet(_S, this, v);
|
|
434
432
|
}
|
|
435
433
|
}, {
|
|
436
|
-
key: "
|
|
434
|
+
key: "virtualBackgroundName",
|
|
437
435
|
get: function get() {
|
|
438
436
|
return _classPrivateFieldGet(_T, this);
|
|
439
437
|
},
|
|
@@ -441,7 +439,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
441
439
|
_classPrivateFieldSet(_T, this, v);
|
|
442
440
|
}
|
|
443
441
|
}, {
|
|
444
|
-
key: "
|
|
442
|
+
key: "enableBeauty",
|
|
445
443
|
get: function get() {
|
|
446
444
|
return _classPrivateFieldGet(_U, this);
|
|
447
445
|
},
|
|
@@ -449,7 +447,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
449
447
|
_classPrivateFieldSet(_U, this, v);
|
|
450
448
|
}
|
|
451
449
|
}, {
|
|
452
|
-
key: "
|
|
450
|
+
key: "beautyKey",
|
|
453
451
|
get: function get() {
|
|
454
452
|
return _classPrivateFieldGet(_V, this);
|
|
455
453
|
},
|
|
@@ -457,7 +455,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
457
455
|
_classPrivateFieldSet(_V, this, v);
|
|
458
456
|
}
|
|
459
457
|
}, {
|
|
460
|
-
key: "
|
|
458
|
+
key: "beautyOptions",
|
|
461
459
|
get: function get() {
|
|
462
460
|
return _classPrivateFieldGet(_W, this);
|
|
463
461
|
},
|
|
@@ -465,7 +463,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
465
463
|
_classPrivateFieldSet(_W, this, v);
|
|
466
464
|
}
|
|
467
465
|
}, {
|
|
468
|
-
key: "
|
|
466
|
+
key: "virtualBackgroundList",
|
|
469
467
|
get: function get() {
|
|
470
468
|
return _classPrivateFieldGet(_X, this);
|
|
471
469
|
},
|
|
@@ -473,7 +471,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
473
471
|
_classPrivateFieldSet(_X, this, v);
|
|
474
472
|
}
|
|
475
473
|
}, {
|
|
476
|
-
key: "
|
|
474
|
+
key: "soundEffectList",
|
|
477
475
|
get: function get() {
|
|
478
476
|
return _classPrivateFieldGet(_Y, this);
|
|
479
477
|
},
|
|
@@ -481,7 +479,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
481
479
|
_classPrivateFieldSet(_Y, this, v);
|
|
482
480
|
}
|
|
483
481
|
}, {
|
|
484
|
-
key: "
|
|
482
|
+
key: "microphoneDetecting",
|
|
485
483
|
get: function get() {
|
|
486
484
|
return _classPrivateFieldGet(_Z, this);
|
|
487
485
|
},
|
|
@@ -489,7 +487,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
489
487
|
_classPrivateFieldSet(_Z, this, v);
|
|
490
488
|
}
|
|
491
489
|
}, {
|
|
492
|
-
key: "
|
|
490
|
+
key: "speakerDetecting",
|
|
493
491
|
get: function get() {
|
|
494
492
|
return _classPrivateFieldGet(_a, this);
|
|
495
493
|
},
|
|
@@ -497,7 +495,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
497
495
|
_classPrivateFieldSet(_a, this, v);
|
|
498
496
|
}
|
|
499
497
|
}, {
|
|
500
|
-
key: "
|
|
498
|
+
key: "connectType",
|
|
501
499
|
get: function get() {
|
|
502
500
|
return _classPrivateFieldGet(_b, this);
|
|
503
501
|
},
|
|
@@ -505,21 +503,13 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
505
503
|
_classPrivateFieldSet(_b, this, v);
|
|
506
504
|
}
|
|
507
505
|
}, {
|
|
508
|
-
key: "
|
|
506
|
+
key: "isMainRoomAudioOff",
|
|
509
507
|
get: function get() {
|
|
510
508
|
return _classPrivateFieldGet(_c, this);
|
|
511
509
|
},
|
|
512
510
|
set: function set(v) {
|
|
513
511
|
_classPrivateFieldSet(_c, this, v);
|
|
514
512
|
}
|
|
515
|
-
}, {
|
|
516
|
-
key: "isMainRoomAudioOff",
|
|
517
|
-
get: function get() {
|
|
518
|
-
return _classPrivateFieldGet(_d, this);
|
|
519
|
-
},
|
|
520
|
-
set: function set(v) {
|
|
521
|
-
_classPrivateFieldSet(_d, this, v);
|
|
522
|
-
}
|
|
523
513
|
}, {
|
|
524
514
|
key: "ifAccessMicrophone",
|
|
525
515
|
value: function () {
|
|
@@ -632,6 +622,11 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
632
622
|
this.setConnectType(_type2.FcrUIConnectType.NONE);
|
|
633
623
|
this._observable.notifyObservers('onAudioDisconnected');
|
|
634
624
|
}
|
|
625
|
+
}, {
|
|
626
|
+
key: "cameraId",
|
|
627
|
+
get: function get() {
|
|
628
|
+
return this._cameraDevice.id || '';
|
|
629
|
+
}
|
|
635
630
|
}, {
|
|
636
631
|
key: "speakerId",
|
|
637
632
|
get: function get() {
|
|
@@ -669,7 +664,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
669
664
|
key: "currentDeviceId",
|
|
670
665
|
get: function get() {
|
|
671
666
|
return {
|
|
672
|
-
cameraDeviceId: this.
|
|
667
|
+
cameraDeviceId: this._cameraDevice.id || '',
|
|
673
668
|
microphoneDeviceId: this._microphoneDevice.id || '',
|
|
674
669
|
speakerDeviceId: this._speakerDevice.id || ''
|
|
675
670
|
};
|
|
@@ -684,6 +679,25 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
684
679
|
get: function get() {
|
|
685
680
|
return !this._sharedSettingDataSource.media.microphoneExpectedOff && this._sharedSettingDataSource.media.autoConnectAudio;
|
|
686
681
|
}
|
|
682
|
+
}, {
|
|
683
|
+
key: "release",
|
|
684
|
+
value: function release() {
|
|
685
|
+
var _this$_cameraVideoTra, _this$_microphoneAudi;
|
|
686
|
+
this._released = true;
|
|
687
|
+
this._mediaControl.removeObserver(this._mediaControlObserver);
|
|
688
|
+
this._toggleLocalCameraPreview(false);
|
|
689
|
+
this._localVideoViewSet.clear();
|
|
690
|
+
(_this$_cameraVideoTra = this._cameraVideoTrack) === null || _this$_cameraVideoTra === void 0 || _this$_cameraVideoTra.stop();
|
|
691
|
+
this._cameraVideoTrack = null;
|
|
692
|
+
this._stopSelectedSpeakerTest();
|
|
693
|
+
this._stopMicrophoneTest();
|
|
694
|
+
(_this$_microphoneAudi = this._microphoneAudioTrack) === null || _this$_microphoneAudi === void 0 || _this$_microphoneAudi.stop();
|
|
695
|
+
this._microphoneAudioTrack = null;
|
|
696
|
+
this._disposer.forEach(function (disposer) {
|
|
697
|
+
return disposer();
|
|
698
|
+
});
|
|
699
|
+
this._disposer = [];
|
|
700
|
+
}
|
|
687
701
|
}, {
|
|
688
702
|
key: "getScreenTrack",
|
|
689
703
|
value: function getScreenTrack(id) {
|
|
@@ -694,11 +708,6 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
694
708
|
value: function getLoopbackTrack(id) {
|
|
695
709
|
return this._mediaControl.getLoopbackTrack(id);
|
|
696
710
|
}
|
|
697
|
-
}, {
|
|
698
|
-
key: "checkLoopbackDevice",
|
|
699
|
-
value: function checkLoopbackDevice() {
|
|
700
|
-
return this._mediaControl.checkLoopbackDevice();
|
|
701
|
-
}
|
|
702
711
|
}, {
|
|
703
712
|
key: "isCapabilitySupported",
|
|
704
713
|
value: function isCapabilitySupported(type) {
|
|
@@ -717,89 +726,12 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
717
726
|
}, {
|
|
718
727
|
key: "cameraTrack",
|
|
719
728
|
get: function get() {
|
|
720
|
-
return this.
|
|
729
|
+
return this._cameraVideoTrack;
|
|
721
730
|
}
|
|
722
731
|
}, {
|
|
723
732
|
key: "microphoneTrack",
|
|
724
733
|
get: function get() {
|
|
725
|
-
return this.
|
|
726
|
-
}
|
|
727
|
-
}, {
|
|
728
|
-
key: "_initDefaultDevice",
|
|
729
|
-
value: function _initDefaultDevice() {
|
|
730
|
-
if (!this._isDeviceListInited) return;
|
|
731
|
-
if (this.cameraList.length > 0) {
|
|
732
|
-
var defaultCameraDeviceId = this.cameraList[0].deviceId;
|
|
733
|
-
this.logger.info('[FcrDeviceStore] select default camera id:', defaultCameraDeviceId);
|
|
734
|
-
this.setCameraId(defaultCameraDeviceId);
|
|
735
|
-
}
|
|
736
|
-
if (this.microphoneList.length > 0) {
|
|
737
|
-
// 默认跟随系统
|
|
738
|
-
this.setMicrophoneId(DEFAULT_DEVICE_ID);
|
|
739
|
-
}
|
|
740
|
-
if (this.speakerList.length > 0) {
|
|
741
|
-
// 默认跟随系统
|
|
742
|
-
this.setSpeakerId(DEFAULT_DEVICE_ID);
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
}, {
|
|
746
|
-
key: "_initDeviceList",
|
|
747
|
-
value: function _initDeviceList() {
|
|
748
|
-
var _this2 = this;
|
|
749
|
-
// this.toggleAGC(true);
|
|
750
|
-
Promise.all([this._mediaControl.getCameraList().then(function (list) {
|
|
751
|
-
if (_this2._released) return;
|
|
752
|
-
(0, _mobx.runInAction)(function () {
|
|
753
|
-
_this2.logger.info("[FcrDeviceStore] init camera list: ".concat((0, _imports.jsonstring)(list)));
|
|
754
|
-
_this2.cameraList = list;
|
|
755
|
-
});
|
|
756
|
-
}), this._getMicrophoneList().then(/*#__PURE__*/function () {
|
|
757
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(microphoneList) {
|
|
758
|
-
return _regenerator["default"].wrap(function (_context3) {
|
|
759
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
760
|
-
case 0:
|
|
761
|
-
if (!_this2._released) {
|
|
762
|
-
_context3.next = 1;
|
|
763
|
-
break;
|
|
764
|
-
}
|
|
765
|
-
return _context3.abrupt("return");
|
|
766
|
-
case 1:
|
|
767
|
-
_this2.microphoneList = microphoneList;
|
|
768
|
-
_this2.logger.info("[FcrDeviceStore] init microphone list: ".concat((0, _imports.jsonstring)(microphoneList)));
|
|
769
|
-
case 2:
|
|
770
|
-
case "end":
|
|
771
|
-
return _context3.stop();
|
|
772
|
-
}
|
|
773
|
-
}, _callee3);
|
|
774
|
-
}));
|
|
775
|
-
return function (_x) {
|
|
776
|
-
return _ref2.apply(this, arguments);
|
|
777
|
-
};
|
|
778
|
-
}()), this._getSpeakerList().then(/*#__PURE__*/function () {
|
|
779
|
-
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(speakerList) {
|
|
780
|
-
return _regenerator["default"].wrap(function (_context4) {
|
|
781
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
782
|
-
case 0:
|
|
783
|
-
if (!_this2._released) {
|
|
784
|
-
_context4.next = 1;
|
|
785
|
-
break;
|
|
786
|
-
}
|
|
787
|
-
return _context4.abrupt("return");
|
|
788
|
-
case 1:
|
|
789
|
-
_this2.speakerList = speakerList;
|
|
790
|
-
_this2.logger.info("[FcrDeviceStore] init speaker list: ".concat((0, _imports.jsonstring)(speakerList)));
|
|
791
|
-
case 2:
|
|
792
|
-
case "end":
|
|
793
|
-
return _context4.stop();
|
|
794
|
-
}
|
|
795
|
-
}, _callee4);
|
|
796
|
-
}));
|
|
797
|
-
return function (_x2) {
|
|
798
|
-
return _ref3.apply(this, arguments);
|
|
799
|
-
};
|
|
800
|
-
}())])["finally"](function () {
|
|
801
|
-
_this2._isDeviceListInited = true;
|
|
802
|
-
});
|
|
734
|
+
return this._microphoneAudioTrack;
|
|
803
735
|
}
|
|
804
736
|
}, {
|
|
805
737
|
key: "addObserver",
|
|
@@ -815,9 +747,8 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
815
747
|
key: "startPlayLocalVideo",
|
|
816
748
|
value: function startPlayLocalVideo(view) {
|
|
817
749
|
var isMirror = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.currentIsMirror;
|
|
818
|
-
if (!this.
|
|
750
|
+
if (!this._cameraVideoTrack || !view) return;
|
|
819
751
|
this._localVideoViewSet.add(view);
|
|
820
|
-
this._cameraVideoTrack = this._mediaControl.getCameraTrack(this.cameraId);
|
|
821
752
|
this._cameraVideoTrack.startPreview({
|
|
822
753
|
renderMode: _fcrCore.FcrVideoRenderMode.HIDDEN,
|
|
823
754
|
isMirror: isMirror
|
|
@@ -827,40 +758,10 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
827
758
|
}, {
|
|
828
759
|
key: "stopPlayLocalVideo",
|
|
829
760
|
value: function stopPlayLocalVideo(view) {
|
|
830
|
-
var _this$
|
|
761
|
+
var _this$_cameraVideoTra2;
|
|
831
762
|
if (!view) return;
|
|
832
763
|
this._localVideoViewSet["delete"](view);
|
|
833
|
-
(_this$
|
|
834
|
-
}
|
|
835
|
-
}, {
|
|
836
|
-
key: "_handleSpeakerDetectingChanged",
|
|
837
|
-
value: function _handleSpeakerDetectingChanged() {
|
|
838
|
-
var _this3 = this;
|
|
839
|
-
if (this.microphoneEnabled) {
|
|
840
|
-
if (this.speakerDetecting) {
|
|
841
|
-
var _this$_microphoneAudi;
|
|
842
|
-
(_this$_microphoneAudi = this._microphoneAudioTrack) === null || _this$_microphoneAudi === void 0 || _this$_microphoneAudi.stop();
|
|
843
|
-
} else {
|
|
844
|
-
var _this$_microphoneAudi2;
|
|
845
|
-
(_this$_microphoneAudi2 = this._microphoneAudioTrack) === null || _this$_microphoneAudi2 === void 0 || _this$_microphoneAudi2.start();
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
this._playAudioTimer && clearInterval(this._playAudioTimer);
|
|
849
|
-
if (this.speakerDetecting) {
|
|
850
|
-
var startSelectedSpeakerTest = function startSelectedSpeakerTest() {
|
|
851
|
-
var _this3$soundEffectLis, _this3$soundEffectLis2;
|
|
852
|
-
var soundUrl = (0, _env.isElectron)() ? (_this3$soundEffectLis = _this3.soundEffectList.get('speaker_test')) === null || _this3$soundEffectLis === void 0 ? void 0 : _this3$soundEffectLis.md5Url : (_this3$soundEffectLis2 = _this3.soundEffectList.get('speaker_test')) === null || _this3$soundEffectLis2 === void 0 ? void 0 : _this3$soundEffectLis2.url;
|
|
853
|
-
_this3._mediaControl.startSelectedSpeakerTest(soundUrl || '', _this3._volumeIndicationInterval);
|
|
854
|
-
};
|
|
855
|
-
startSelectedSpeakerTest();
|
|
856
|
-
var sleep = 3000;
|
|
857
|
-
this._playAudioTimer = setInterval(function () {
|
|
858
|
-
startSelectedSpeakerTest();
|
|
859
|
-
}, sleep);
|
|
860
|
-
} else {
|
|
861
|
-
this._mediaControl.stopSelectedSpeakerTest();
|
|
862
|
-
this.speakerVolumeLevel = 0;
|
|
863
|
-
}
|
|
764
|
+
(_this$_cameraVideoTra2 = this._cameraVideoTrack) === null || _this$_cameraVideoTra2 === void 0 || _this$_cameraVideoTra2.stopPreview(view);
|
|
864
765
|
}
|
|
865
766
|
}, {
|
|
866
767
|
key: "startSpeakerTest",
|
|
@@ -880,12 +781,12 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
880
781
|
}, {
|
|
881
782
|
key: "toggleLocalMirrorPreview",
|
|
882
783
|
value: function toggleLocalMirrorPreview(mirror) {
|
|
883
|
-
var
|
|
784
|
+
var _this2 = this;
|
|
884
785
|
this.setCurrentIsMirror(mirror);
|
|
885
786
|
this._localVideoViewSet.forEach(function (view) {
|
|
886
|
-
var
|
|
887
|
-
(
|
|
888
|
-
(
|
|
787
|
+
var _this2$_cameraVideoTr, _this2$_cameraVideoTr2;
|
|
788
|
+
(_this2$_cameraVideoTr = _this2._cameraVideoTrack) === null || _this2$_cameraVideoTr === void 0 || _this2$_cameraVideoTr.stopPreview(view);
|
|
789
|
+
(_this2$_cameraVideoTr2 = _this2._cameraVideoTrack) === null || _this2$_cameraVideoTr2 === void 0 || _this2$_cameraVideoTr2.startPreview({
|
|
889
790
|
renderMode: _fcrCore.FcrVideoRenderMode.HIDDEN,
|
|
890
791
|
isMirror: mirror
|
|
891
792
|
}, view);
|
|
@@ -895,8 +796,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
895
796
|
key: "setBeautyOptions",
|
|
896
797
|
value: function setBeautyOptions(beautyOption) {
|
|
897
798
|
Object.assign(this.beautyOptions, beautyOption);
|
|
898
|
-
if (!this.
|
|
899
|
-
this._cameraVideoTrack = this._mediaControl.getCameraTrack(this.cameraId);
|
|
799
|
+
if (!this._cameraVideoTrack) return;
|
|
900
800
|
this._cameraVideoTrack.getVideoEffectEnhancer().setBeautyOptions({
|
|
901
801
|
lighteningContrastLevel: (0, _tools.convertToFixedNumber)(this.beautyOptions.lighteningContrastLevel),
|
|
902
802
|
lighteningLevel: (0, _tools.convertToFixedNumber)(this.beautyOptions.lighteningLevel),
|
|
@@ -913,66 +813,54 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
913
813
|
}, {
|
|
914
814
|
key: "handleForceOpenVideoEffect",
|
|
915
815
|
value: function handleForceOpenVideoEffect() {
|
|
816
|
+
var _this3 = this;
|
|
817
|
+
var reset = function reset() {
|
|
818
|
+
_this3.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.NONE;
|
|
819
|
+
_this3.showForceOpenEffectDialog = false;
|
|
820
|
+
};
|
|
916
821
|
if (this.lastEnableVideoEffectType === _type2.FcrUIVideoEffectType.BEAUTY) {
|
|
917
822
|
this._isForceEnableBeauty = true;
|
|
918
823
|
this.enableBeautyEffect(true);
|
|
919
|
-
|
|
920
|
-
this.showForceOpenEffectDialog = false;
|
|
824
|
+
reset();
|
|
921
825
|
return;
|
|
922
826
|
}
|
|
923
827
|
if (this.lastEnableVideoEffectType === _type2.FcrUIVideoEffectType.VIRTUAL_BACKGROUND) {
|
|
924
828
|
this._isForceEnableVirtualBackground = true;
|
|
925
829
|
this.enableVirtualBackground(true);
|
|
926
|
-
|
|
927
|
-
this.showForceOpenEffectDialog = false;
|
|
830
|
+
reset();
|
|
928
831
|
return;
|
|
929
832
|
}
|
|
930
833
|
}
|
|
931
834
|
}, {
|
|
932
835
|
key: "setVideoOrientation",
|
|
933
836
|
value: function setVideoOrientation() {
|
|
934
|
-
var _this$
|
|
935
|
-
if (this._videoRotation === _type.
|
|
936
|
-
this._videoRotation = _type.
|
|
837
|
+
var _this$_cameraVideoTra3;
|
|
838
|
+
if (this._videoRotation === _type.FcrVideoOrientation.VIDEO_ORIENTATION_270) {
|
|
839
|
+
this._videoRotation = _type.FcrVideoOrientation.VIDEO_ORIENTATION_0;
|
|
937
840
|
} else {
|
|
938
841
|
this._videoRotation = this._videoRotation + 1;
|
|
939
842
|
}
|
|
940
|
-
(_this$
|
|
843
|
+
(_this$_cameraVideoTra3 = this._cameraVideoTrack) === null || _this$_cameraVideoTra3 === void 0 || _this$_cameraVideoTra3.setVideoOrientation(this._videoRotation);
|
|
941
844
|
}
|
|
942
845
|
}, {
|
|
943
846
|
key: "setCameraEnabled",
|
|
944
847
|
value: function setCameraEnabled(enable) {
|
|
945
|
-
if (enable) {
|
|
946
|
-
this._hasExecutedOpenCamera = true;
|
|
947
|
-
}
|
|
948
|
-
this.startOrStopCamera(enable);
|
|
949
|
-
this.setShowCameraPreview(enable);
|
|
950
848
|
this.cameraEnabled = enable;
|
|
951
849
|
}
|
|
952
850
|
}, {
|
|
953
|
-
key: "
|
|
954
|
-
value: function
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
if (this.microphoneEnabled) {
|
|
958
|
-
var _this$_microphoneAudi3;
|
|
959
|
-
(_this$_microphoneAudi3 = this._microphoneAudioTrack) === null || _this$_microphoneAudi3 === void 0 || _this$_microphoneAudi3.start();
|
|
960
|
-
} else {
|
|
961
|
-
var _this$_microphoneAudi4;
|
|
962
|
-
(_this$_microphoneAudi4 = this._microphoneAudioTrack) === null || _this$_microphoneAudi4 === void 0 || _this$_microphoneAudi4.stop();
|
|
963
|
-
this.microphoneVolumeLevel = 0;
|
|
851
|
+
key: "_handleCameraEnabledChanged",
|
|
852
|
+
value: function _handleCameraEnabledChanged() {
|
|
853
|
+
if (this.cameraEnabled) {
|
|
854
|
+
this._hasExecutedOpenCamera = true;
|
|
964
855
|
}
|
|
856
|
+
this._handleCameraVideoTrack();
|
|
857
|
+
this.setShowCameraPreview(this.cameraEnabled);
|
|
965
858
|
}
|
|
966
859
|
}, {
|
|
967
860
|
key: "setMicrophoneEnabled",
|
|
968
861
|
value: function setMicrophoneEnabled(enable) {
|
|
969
862
|
this.microphoneEnabled = enable;
|
|
970
863
|
}
|
|
971
|
-
}, {
|
|
972
|
-
key: "_handleMicrophoneEnabledChanged",
|
|
973
|
-
value: function _handleMicrophoneEnabledChanged() {
|
|
974
|
-
this._handleMicrophoneAudioTrack();
|
|
975
|
-
}
|
|
976
864
|
}, {
|
|
977
865
|
key: "toggleLocalMirror",
|
|
978
866
|
value: function toggleLocalMirror(enable) {
|
|
@@ -986,18 +874,6 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
986
874
|
this.isLocalMirrorEnabled = false;
|
|
987
875
|
this.setCurrentIsMirror(false);
|
|
988
876
|
}
|
|
989
|
-
}, {
|
|
990
|
-
key: "_handleMicrophoneDetectingChanged",
|
|
991
|
-
value: function _handleMicrophoneDetectingChanged() {
|
|
992
|
-
if (this.microphoneDetecting) {
|
|
993
|
-
var _this$_microphoneAudi5;
|
|
994
|
-
(_this$_microphoneAudi5 = this._microphoneAudioTrack) === null || _this$_microphoneAudi5 === void 0 || _this$_microphoneAudi5.startTest(this._volumeIndicationInterval);
|
|
995
|
-
} else {
|
|
996
|
-
var _this$_microphoneAudi6;
|
|
997
|
-
(_this$_microphoneAudi6 = this._microphoneAudioTrack) === null || _this$_microphoneAudi6 === void 0 || _this$_microphoneAudi6.stopTest();
|
|
998
|
-
this.microphoneVolumeLevel = 0;
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
877
|
}, {
|
|
1002
878
|
key: "startMicrophoneTest",
|
|
1003
879
|
value: function startMicrophoneTest() {
|
|
@@ -1011,28 +887,33 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1011
887
|
}, {
|
|
1012
888
|
key: "enableVirtualBackground",
|
|
1013
889
|
value: function enableVirtualBackground(enable, source) {
|
|
1014
|
-
if (!this.
|
|
1015
|
-
|
|
890
|
+
if (!this._cameraVideoTrack) return;
|
|
891
|
+
if (!enable) {
|
|
892
|
+
this.virtualBackgroundName = 'None';
|
|
893
|
+
} else {
|
|
894
|
+
if (source) {
|
|
895
|
+
this.virtualBackgroundName = source.name;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
var videoEffectEnhancer = this._cameraVideoTrack.getVideoEffectEnhancer();
|
|
1016
899
|
if (source) {
|
|
1017
|
-
|
|
1018
|
-
this._cameraVideoTrack.getVideoEffectEnhancer().setVirtualBackgroundOptions({
|
|
900
|
+
videoEffectEnhancer.setVirtualBackgroundOptions({
|
|
1019
901
|
source: source === null || source === void 0 ? void 0 : source.path,
|
|
1020
902
|
type: source === null || source === void 0 ? void 0 : source.type
|
|
1021
903
|
});
|
|
1022
904
|
}
|
|
1023
905
|
if (!enable) {
|
|
1024
|
-
this.virtualBackgroundName = 'None';
|
|
1025
906
|
this._isForceEnableVirtualBackground = false;
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
907
|
+
videoEffectEnhancer.disableVirtualBackground();
|
|
908
|
+
} else {
|
|
909
|
+
var isSatisfyVirtualBackgroundRequirements = videoEffectEnhancer.checkSatisfyVirtualBackgroundRequirements() || this._isForceEnableVirtualBackground;
|
|
910
|
+
if (isSatisfyVirtualBackgroundRequirements) {
|
|
911
|
+
videoEffectEnhancer.enableVirtualBackground();
|
|
912
|
+
} else {
|
|
913
|
+
this.showForceOpenEffectDialog = true;
|
|
914
|
+
this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.VIRTUAL_BACKGROUND;
|
|
915
|
+
}
|
|
1032
916
|
}
|
|
1033
|
-
this.showForceOpenEffectDialog = true;
|
|
1034
|
-
this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.VIRTUAL_BACKGROUND;
|
|
1035
|
-
return;
|
|
1036
917
|
}
|
|
1037
918
|
}, {
|
|
1038
919
|
key: "setEditBeautyKey",
|
|
@@ -1043,191 +924,102 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1043
924
|
}, {
|
|
1044
925
|
key: "enableBeautyEffect",
|
|
1045
926
|
value: function enableBeautyEffect(enable) {
|
|
1046
|
-
if (!this.
|
|
1047
|
-
|
|
1048
|
-
if (
|
|
927
|
+
if (!this._cameraVideoTrack) return;
|
|
928
|
+
var videoEffectEnhancer = this._cameraVideoTrack.getVideoEffectEnhancer();
|
|
929
|
+
if (enable) {
|
|
930
|
+
var isSatisfyBeautyRequirements = videoEffectEnhancer.checkSatisfyBeautyRequirements() || this._isForceEnableBeauty;
|
|
931
|
+
1;
|
|
932
|
+
if (isSatisfyBeautyRequirements) {
|
|
933
|
+
this.enableBeauty = true;
|
|
934
|
+
this.setBeautyOptions(this.beautyOptions);
|
|
935
|
+
videoEffectEnhancer.enableBeauty();
|
|
936
|
+
} else {
|
|
937
|
+
this.showForceOpenEffectDialog = true;
|
|
938
|
+
this.enableBeauty = false;
|
|
939
|
+
this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.BEAUTY;
|
|
940
|
+
}
|
|
941
|
+
} else {
|
|
1049
942
|
this.enableBeauty = false;
|
|
1050
943
|
this.setEditBeautyKey('none');
|
|
1051
944
|
this._isForceEnableBeauty = false;
|
|
1052
|
-
|
|
1053
|
-
return;
|
|
945
|
+
videoEffectEnhancer.disableBeauty();
|
|
1054
946
|
}
|
|
1055
|
-
if (this._cameraVideoTrack.getVideoEffectEnhancer().checkSatisfyBeautyRequirements() || this._isForceEnableBeauty) {
|
|
1056
|
-
this.enableBeauty = true;
|
|
1057
|
-
this.setBeautyOptions(this.beautyOptions);
|
|
1058
|
-
this._cameraVideoTrack.getVideoEffectEnhancer().enableBeauty();
|
|
1059
|
-
return;
|
|
1060
|
-
}
|
|
1061
|
-
this.showForceOpenEffectDialog = true;
|
|
1062
|
-
this.enableBeauty = false;
|
|
1063
|
-
this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.BEAUTY;
|
|
1064
|
-
return;
|
|
1065
947
|
}
|
|
1066
948
|
|
|
1067
949
|
// 高保真
|
|
1068
950
|
}, {
|
|
1069
951
|
key: "enableAudioHiFiMode",
|
|
1070
952
|
value: function enableAudioHiFiMode(enable) {
|
|
1071
|
-
if (!this.
|
|
1072
|
-
var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
|
|
953
|
+
if (!this._microphoneAudioTrack) return;
|
|
1073
954
|
if (enable) {
|
|
1074
|
-
|
|
955
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().enableHiFiMode();
|
|
1075
956
|
return;
|
|
957
|
+
} else {
|
|
958
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().disableHiFiMode();
|
|
1076
959
|
}
|
|
1077
|
-
microphoneAudioTrack.getAudioEffectEnhancer().disableHiFiMode();
|
|
1078
960
|
}
|
|
1079
961
|
|
|
1080
962
|
// 回声消除
|
|
1081
963
|
}, {
|
|
1082
964
|
key: "enableAudioEchoCancellation",
|
|
1083
965
|
value: function enableAudioEchoCancellation(enable) {
|
|
1084
|
-
if (!this.
|
|
1085
|
-
var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
|
|
966
|
+
if (!this._microphoneAudioTrack) return;
|
|
1086
967
|
if (enable) {
|
|
1087
|
-
|
|
1088
|
-
|
|
968
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().enableEchoCancellation();
|
|
969
|
+
} else {
|
|
970
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().disableEchoCancellation();
|
|
1089
971
|
}
|
|
1090
|
-
microphoneAudioTrack.getAudioEffectEnhancer().disableEchoCancellation();
|
|
1091
972
|
}
|
|
1092
973
|
|
|
1093
974
|
// 立体声
|
|
1094
975
|
}, {
|
|
1095
976
|
key: "enableAudioStereo",
|
|
1096
977
|
value: function enableAudioStereo(enable) {
|
|
1097
|
-
if (!this.
|
|
1098
|
-
var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
|
|
978
|
+
if (!this._microphoneAudioTrack) return;
|
|
1099
979
|
if (enable) {
|
|
1100
|
-
|
|
1101
|
-
|
|
980
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().enableStereoMode();
|
|
981
|
+
} else {
|
|
982
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().disableStereoMode();
|
|
1102
983
|
}
|
|
1103
|
-
microphoneAudioTrack.getAudioEffectEnhancer().disableStereoMode();
|
|
1104
984
|
}
|
|
1105
985
|
|
|
1106
986
|
// 噪音抑制等级
|
|
1107
987
|
}, {
|
|
1108
988
|
key: "setNoiseLevel",
|
|
1109
989
|
value: function setNoiseLevel(level) {
|
|
1110
|
-
if (!this.
|
|
1111
|
-
var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
|
|
990
|
+
if (!this._microphoneAudioTrack) return;
|
|
1112
991
|
if (level === _type2.FcrUIAiDenoiseLevel.CLOSE) {
|
|
1113
|
-
|
|
992
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().disableAiDenoiser();
|
|
1114
993
|
} else {
|
|
1115
|
-
|
|
1116
|
-
|
|
994
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().enableAiDenoiser();
|
|
995
|
+
this._microphoneAudioTrack.getAudioEffectEnhancer().setAiDenoiseLevel(level);
|
|
1117
996
|
}
|
|
1118
997
|
}
|
|
1119
998
|
}, {
|
|
1120
999
|
key: "setCameraId",
|
|
1121
1000
|
value: function setCameraId(cameraId) {
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
// stop current camera track
|
|
1126
|
-
cameraTrack === null || cameraTrack === void 0 || cameraTrack.stopTest();
|
|
1127
|
-
cameraTrack === null || cameraTrack === void 0 || cameraTrack.stop();
|
|
1128
|
-
if (cameraId) {
|
|
1129
|
-
var _cameraTrack = this._mediaControl.getCameraTrack(cameraId);
|
|
1130
|
-
if (enable) {
|
|
1131
|
-
_cameraTrack.start();
|
|
1132
|
-
}
|
|
1133
|
-
this._cameraVideoTrack = _cameraTrack;
|
|
1134
|
-
}
|
|
1135
|
-
this.cameraId = cameraId;
|
|
1136
|
-
this._observable.notifyObservers('onCameraChanged', cameraId);
|
|
1001
|
+
this._cameraDevice = {
|
|
1002
|
+
id: cameraId
|
|
1003
|
+
};
|
|
1137
1004
|
}
|
|
1138
1005
|
}, {
|
|
1139
|
-
key: "
|
|
1140
|
-
value: function () {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
1144
|
-
case 0:
|
|
1145
|
-
if (!this.followSystemMicrophoneDevice) {
|
|
1146
|
-
this._microphoneDevice = {
|
|
1147
|
-
id: this._microphone.id
|
|
1148
|
-
};
|
|
1149
|
-
} else {
|
|
1150
|
-
this._correctSystemSelectedMicrophoneDeviceId();
|
|
1151
|
-
}
|
|
1152
|
-
this._mediaControl.observeSystemSelectedMicrophoneChanged(this.followSystemMicrophoneDevice);
|
|
1153
|
-
case 1:
|
|
1154
|
-
case "end":
|
|
1155
|
-
return _context5.stop();
|
|
1156
|
-
}
|
|
1157
|
-
}, _callee5, this);
|
|
1158
|
-
}));
|
|
1159
|
-
function _handleMicrophoneIdChanged() {
|
|
1160
|
-
return _handleMicrophoneIdChanged2.apply(this, arguments);
|
|
1161
|
-
}
|
|
1162
|
-
return _handleMicrophoneIdChanged;
|
|
1163
|
-
}()
|
|
1006
|
+
key: "setMainRoomAudioOff",
|
|
1007
|
+
value: function setMainRoomAudioOff(enable) {
|
|
1008
|
+
this.isMainRoomAudioOff = enable;
|
|
1009
|
+
}
|
|
1164
1010
|
}, {
|
|
1165
|
-
key: "
|
|
1166
|
-
value: function
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
} else {
|
|
1171
|
-
var _this$_microphoneAudi7, _this$_microphoneAudi8;
|
|
1172
|
-
(_this$_microphoneAudi7 = this._microphoneAudioTrack) === null || _this$_microphoneAudi7 === void 0 || _this$_microphoneAudi7.removeObserver(this._microphoneObserver);
|
|
1173
|
-
(_this$_microphoneAudi8 = this._microphoneAudioTrack) === null || _this$_microphoneAudi8 === void 0 || _this$_microphoneAudi8.stop();
|
|
1174
|
-
this._microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
|
|
1175
|
-
this._microphoneAudioTrack.addObserver(this._microphoneObserver);
|
|
1176
|
-
this._handleMicrophoneAudioTrack();
|
|
1177
|
-
this._observable.notifyObservers('onMicrophoneChanged', this._microphoneDevice.id);
|
|
1178
|
-
this.setNoiseLevel(this._sharedSettingDataSource.setting.noiseReduce);
|
|
1179
|
-
}
|
|
1011
|
+
key: "setSpeakerId",
|
|
1012
|
+
value: function setSpeakerId(speakerId) {
|
|
1013
|
+
this._speaker = {
|
|
1014
|
+
id: speakerId
|
|
1015
|
+
};
|
|
1180
1016
|
}
|
|
1181
1017
|
}, {
|
|
1182
|
-
key: "
|
|
1183
|
-
value: function
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
} else {
|
|
1188
|
-
this._mediaControl.setSelectedSpeaker(this._speakerDevice.id);
|
|
1189
|
-
this._observable.notifyObservers('onSpeakerChanged', this._speakerDevice.id);
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
}, {
|
|
1193
|
-
key: "_handleSpeakerIdChanged",
|
|
1194
|
-
value: function () {
|
|
1195
|
-
var _handleSpeakerIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
1196
|
-
return _regenerator["default"].wrap(function (_context6) {
|
|
1197
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
1198
|
-
case 0:
|
|
1199
|
-
if (!this.followSystemSpeakerDevice) {
|
|
1200
|
-
this._speakerDevice = {
|
|
1201
|
-
id: this._speaker.id
|
|
1202
|
-
};
|
|
1203
|
-
} else {
|
|
1204
|
-
this._correctSystemSpeakerDeviceId();
|
|
1205
|
-
}
|
|
1206
|
-
this._mediaControl.observeSystemSelectedSpeakerChanged(this.followSystemSpeakerDevice);
|
|
1207
|
-
case 1:
|
|
1208
|
-
case "end":
|
|
1209
|
-
return _context6.stop();
|
|
1210
|
-
}
|
|
1211
|
-
}, _callee6, this);
|
|
1212
|
-
}));
|
|
1213
|
-
function _handleSpeakerIdChanged() {
|
|
1214
|
-
return _handleSpeakerIdChanged2.apply(this, arguments);
|
|
1215
|
-
}
|
|
1216
|
-
return _handleSpeakerIdChanged;
|
|
1217
|
-
}()
|
|
1218
|
-
}, {
|
|
1219
|
-
key: "setSpeakerId",
|
|
1220
|
-
value: function setSpeakerId(speakerId) {
|
|
1221
|
-
this._speaker = {
|
|
1222
|
-
id: speakerId
|
|
1223
|
-
};
|
|
1224
|
-
}
|
|
1225
|
-
}, {
|
|
1226
|
-
key: "setMicrophoneId",
|
|
1227
|
-
value: function setMicrophoneId(microphoneId) {
|
|
1228
|
-
this._microphone = {
|
|
1229
|
-
id: microphoneId
|
|
1230
|
-
};
|
|
1018
|
+
key: "setMicrophoneId",
|
|
1019
|
+
value: function setMicrophoneId(microphoneId) {
|
|
1020
|
+
this._microphone = {
|
|
1021
|
+
id: microphoneId
|
|
1022
|
+
};
|
|
1231
1023
|
}
|
|
1232
1024
|
}, {
|
|
1233
1025
|
key: "setSpeakerVolume",
|
|
@@ -1238,25 +1030,14 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1238
1030
|
}, {
|
|
1239
1031
|
key: "setMicrophoneVolume",
|
|
1240
1032
|
value: function setMicrophoneVolume(value) {
|
|
1241
|
-
var _this$
|
|
1033
|
+
var _this$_microphoneAudi2;
|
|
1242
1034
|
this.microphoneVolume = value;
|
|
1243
|
-
(_this$
|
|
1035
|
+
(_this$_microphoneAudi2 = this._microphoneAudioTrack) === null || _this$_microphoneAudi2 === void 0 || _this$_microphoneAudi2.adjustVolume(value);
|
|
1244
1036
|
}
|
|
1245
1037
|
}, {
|
|
1246
1038
|
key: "startOrStopCamera",
|
|
1247
1039
|
value: function startOrStopCamera(enable) {
|
|
1248
|
-
|
|
1249
|
-
var localVideoViewSet = this._localVideoViewSet;
|
|
1250
|
-
if (enable) {
|
|
1251
|
-
cameraTrack === null || cameraTrack === void 0 || cameraTrack.start();
|
|
1252
|
-
} else {
|
|
1253
|
-
if (localVideoViewSet.size > 0 && cameraTrack) {
|
|
1254
|
-
localVideoViewSet.forEach(function (view) {
|
|
1255
|
-
cameraTrack.stopPreview(view);
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
cameraTrack === null || cameraTrack === void 0 || cameraTrack.stop();
|
|
1259
|
-
}
|
|
1040
|
+
this._handleCameraVideoTrack(enable);
|
|
1260
1041
|
}
|
|
1261
1042
|
}, {
|
|
1262
1043
|
key: "setShowCameraPreview",
|
|
@@ -1266,14 +1047,14 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1266
1047
|
}, {
|
|
1267
1048
|
key: "loadUiResources",
|
|
1268
1049
|
value: function () {
|
|
1269
|
-
var _loadUiResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1270
|
-
var
|
|
1050
|
+
var _loadUiResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(uiResource) {
|
|
1051
|
+
var _this4 = this;
|
|
1271
1052
|
var _uiResource$virtualBa, _uiResource$virtualBa2, _uiResource$soundEffe, images, videos, soundEffects, newList, imageInfoList, videoInfoList, _uiResource$virtualBa3, _uiResource$virtualBa4, _uiResource$soundEffe2, _images, _videos, _soundEffects, handleResourceReady;
|
|
1272
|
-
return _regenerator["default"].wrap(function (
|
|
1273
|
-
while (1) switch (
|
|
1053
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
1054
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
1274
1055
|
case 0:
|
|
1275
1056
|
if ((0, _env.isElectron)()) {
|
|
1276
|
-
|
|
1057
|
+
_context3.next = 1;
|
|
1277
1058
|
break;
|
|
1278
1059
|
}
|
|
1279
1060
|
images = (uiResource === null || uiResource === void 0 || (_uiResource$virtualBa = uiResource.virtualBackgroundImages) === null || _uiResource$virtualBa === void 0 ? void 0 : _uiResource$virtualBa.filter(function (url) {
|
|
@@ -1305,7 +1086,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1305
1086
|
}) || [];
|
|
1306
1087
|
newList = newList.concat(videoInfoList);
|
|
1307
1088
|
(0, _mobx.runInAction)(function () {
|
|
1308
|
-
|
|
1089
|
+
_this4._updateVirtualBackgroundList(newList);
|
|
1309
1090
|
var soundEffectInfoList = soundEffects.map(function (url) {
|
|
1310
1091
|
return {
|
|
1311
1092
|
url: url,
|
|
@@ -1313,13 +1094,13 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1313
1094
|
};
|
|
1314
1095
|
}) || [];
|
|
1315
1096
|
soundEffectInfoList.forEach(function (item) {
|
|
1316
|
-
|
|
1097
|
+
_this4.soundEffectList.set((0, _tools.getFileNameWithoutExtension)(item.url), item);
|
|
1317
1098
|
});
|
|
1318
1099
|
});
|
|
1319
|
-
|
|
1100
|
+
_context3.next = 3;
|
|
1320
1101
|
break;
|
|
1321
1102
|
case 1:
|
|
1322
|
-
|
|
1103
|
+
_context3.next = 2;
|
|
1323
1104
|
return this._loadBuiltinResources();
|
|
1324
1105
|
case 2:
|
|
1325
1106
|
_images = (uiResource === null || uiResource === void 0 || (_uiResource$virtualBa3 = uiResource.virtualBackgroundImages) === null || _uiResource$virtualBa3 === void 0 ? void 0 : _uiResource$virtualBa3.filter(function (url) {
|
|
@@ -1333,7 +1114,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1333
1114
|
})) || [];
|
|
1334
1115
|
handleResourceReady = function handleResourceReady(filePathList, type) {
|
|
1335
1116
|
if (type === 'image' || type === 'video') {
|
|
1336
|
-
var list =
|
|
1117
|
+
var list = _this4.virtualBackgroundList.slice();
|
|
1337
1118
|
var resourceType = type === 'image' ? _virtualBackdoundResources.VirtualOption.IMG : _virtualBackdoundResources.VirtualOption.VIDEO;
|
|
1338
1119
|
list = filePathList.map(function (resource) {
|
|
1339
1120
|
return {
|
|
@@ -1343,12 +1124,12 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1343
1124
|
url: URL.createObjectURL(window.runtime.fileToBlob(resource, type))
|
|
1344
1125
|
};
|
|
1345
1126
|
});
|
|
1346
|
-
var _newList =
|
|
1347
|
-
|
|
1127
|
+
var _newList = _this4.virtualBackgroundList.concat(list);
|
|
1128
|
+
_this4._updateVirtualBackgroundList(_newList);
|
|
1348
1129
|
} else if (type === 'audio') {
|
|
1349
1130
|
filePathList.forEach(function (resource) {
|
|
1350
1131
|
var key = (0, _tools.getFileNameWithoutExtension)(resource);
|
|
1351
|
-
|
|
1132
|
+
_this4.soundEffectList.set(key, {
|
|
1352
1133
|
md5Url: resource,
|
|
1353
1134
|
url: URL.createObjectURL(window.runtime.fileToBlob(resource, type))
|
|
1354
1135
|
});
|
|
@@ -1360,11 +1141,11 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1360
1141
|
this.loadZipResources(_soundEffects, 'audio', handleResourceReady);
|
|
1361
1142
|
case 3:
|
|
1362
1143
|
case "end":
|
|
1363
|
-
return
|
|
1144
|
+
return _context3.stop();
|
|
1364
1145
|
}
|
|
1365
|
-
},
|
|
1146
|
+
}, _callee3, this);
|
|
1366
1147
|
}));
|
|
1367
|
-
function loadUiResources(
|
|
1148
|
+
function loadUiResources(_x) {
|
|
1368
1149
|
return _loadUiResources.apply(this, arguments);
|
|
1369
1150
|
}
|
|
1370
1151
|
return loadUiResources;
|
|
@@ -1372,42 +1153,42 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1372
1153
|
}, {
|
|
1373
1154
|
key: "loadZipResources",
|
|
1374
1155
|
value: function () {
|
|
1375
|
-
var _loadZipResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1376
|
-
var
|
|
1156
|
+
var _loadZipResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(zipUrls, type, callback) {
|
|
1157
|
+
var _this5 = this;
|
|
1377
1158
|
var ps;
|
|
1378
|
-
return _regenerator["default"].wrap(function (
|
|
1379
|
-
while (1) switch (
|
|
1159
|
+
return _regenerator["default"].wrap(function (_context5) {
|
|
1160
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1380
1161
|
case 0:
|
|
1381
1162
|
ps = zipUrls.map(/*#__PURE__*/function () {
|
|
1382
|
-
var
|
|
1163
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(url) {
|
|
1383
1164
|
var filePathList;
|
|
1384
|
-
return _regenerator["default"].wrap(function (
|
|
1385
|
-
while (1) switch (
|
|
1165
|
+
return _regenerator["default"].wrap(function (_context4) {
|
|
1166
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
1386
1167
|
case 0:
|
|
1387
|
-
|
|
1388
|
-
return
|
|
1168
|
+
_context4.next = 1;
|
|
1169
|
+
return _this5._fetchZipAndUnzip(url, type);
|
|
1389
1170
|
case 1:
|
|
1390
|
-
filePathList =
|
|
1171
|
+
filePathList = _context4.sent;
|
|
1391
1172
|
callback(filePathList, type);
|
|
1392
1173
|
case 2:
|
|
1393
1174
|
case "end":
|
|
1394
|
-
return
|
|
1175
|
+
return _context4.stop();
|
|
1395
1176
|
}
|
|
1396
|
-
},
|
|
1177
|
+
}, _callee4);
|
|
1397
1178
|
}));
|
|
1398
|
-
return function (
|
|
1399
|
-
return
|
|
1179
|
+
return function (_x5) {
|
|
1180
|
+
return _ref2.apply(this, arguments);
|
|
1400
1181
|
};
|
|
1401
1182
|
}());
|
|
1402
|
-
|
|
1183
|
+
_context5.next = 1;
|
|
1403
1184
|
return Promise.allSettled(ps);
|
|
1404
1185
|
case 1:
|
|
1405
1186
|
case "end":
|
|
1406
|
-
return
|
|
1187
|
+
return _context5.stop();
|
|
1407
1188
|
}
|
|
1408
|
-
},
|
|
1189
|
+
}, _callee5);
|
|
1409
1190
|
}));
|
|
1410
|
-
function loadZipResources(
|
|
1191
|
+
function loadZipResources(_x2, _x3, _x4) {
|
|
1411
1192
|
return _loadZipResources.apply(this, arguments);
|
|
1412
1193
|
}
|
|
1413
1194
|
return loadZipResources;
|
|
@@ -1421,36 +1202,285 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1421
1202
|
return this._mediaControl.disableAGC();
|
|
1422
1203
|
}
|
|
1423
1204
|
}
|
|
1424
|
-
}, {
|
|
1425
|
-
key: "release",
|
|
1426
|
-
value: function release() {
|
|
1427
|
-
var _this7 = this,
|
|
1428
|
-
_this$_cameraVideoTra3,
|
|
1429
|
-
_this$_microphoneAudi0;
|
|
1430
|
-
this._released = true;
|
|
1431
|
-
this._mediaControl.removeObserver(this._mediaControlObserver);
|
|
1432
|
-
if (this._localVideoViewSet.size > 0) {
|
|
1433
|
-
this._localVideoViewSet.forEach(function (view) {
|
|
1434
|
-
var _this7$_cameraVideoTr;
|
|
1435
|
-
(_this7$_cameraVideoTr = _this7._cameraVideoTrack) === null || _this7$_cameraVideoTr === void 0 || _this7$_cameraVideoTr.stopPreview(view);
|
|
1436
|
-
});
|
|
1437
|
-
this._localVideoViewSet.clear();
|
|
1438
|
-
}
|
|
1439
|
-
this.speakerDetecting = false;
|
|
1440
|
-
this.microphoneDetecting = false;
|
|
1441
|
-
(_this$_cameraVideoTra3 = this._cameraVideoTrack) === null || _this$_cameraVideoTra3 === void 0 || _this$_cameraVideoTra3.stop();
|
|
1442
|
-
(_this$_microphoneAudi0 = this._microphoneAudioTrack) === null || _this$_microphoneAudi0 === void 0 || _this$_microphoneAudi0.stop();
|
|
1443
|
-
this._cameraVideoTrack = undefined;
|
|
1444
|
-
this._microphoneAudioTrack = null;
|
|
1445
|
-
this._disposer.forEach(function (disposer) {
|
|
1446
|
-
return disposer();
|
|
1447
|
-
});
|
|
1448
|
-
}
|
|
1449
1205
|
}, {
|
|
1450
1206
|
key: "setConnectType",
|
|
1451
1207
|
value: function setConnectType(connectType) {
|
|
1452
1208
|
this.connectType = connectType;
|
|
1453
1209
|
}
|
|
1210
|
+
}, {
|
|
1211
|
+
key: "toggleLocalCameraPreview",
|
|
1212
|
+
value: function toggleLocalCameraPreview(enabled) {
|
|
1213
|
+
return this._toggleLocalCameraPreview(enabled);
|
|
1214
|
+
}
|
|
1215
|
+
}, {
|
|
1216
|
+
key: "getLoopbackDeviceId",
|
|
1217
|
+
value: function getLoopbackDeviceId() {
|
|
1218
|
+
if ((0, _env.isElectron)()) {
|
|
1219
|
+
var loopbackList = this._mediaControl.getLoopbackList();
|
|
1220
|
+
if (loopbackList.length > 0) {
|
|
1221
|
+
return loopbackList[0].deviceId;
|
|
1222
|
+
}
|
|
1223
|
+
return null;
|
|
1224
|
+
} else {
|
|
1225
|
+
return 'default';
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
}, {
|
|
1229
|
+
key: "_initDeviceList",
|
|
1230
|
+
value: function _initDeviceList() {
|
|
1231
|
+
var _this6 = this;
|
|
1232
|
+
// this.toggleAGC(true);
|
|
1233
|
+
Promise.all([this._mediaControl.getCameraList().then(function (list) {
|
|
1234
|
+
if (_this6._released) return;
|
|
1235
|
+
_this6.cameraList = list;
|
|
1236
|
+
_this6.logger.info("[FcrDeviceStore] init camera list: ".concat((0, _imports.jsonstring)(list)));
|
|
1237
|
+
if (_this6.cameraList.length > 0) {
|
|
1238
|
+
var defaultCameraDeviceId = _this6.cameraList[0].deviceId;
|
|
1239
|
+
_this6.logger.info('[FcrDeviceStore] select default camera id:', defaultCameraDeviceId);
|
|
1240
|
+
_this6.setCameraId(defaultCameraDeviceId);
|
|
1241
|
+
}
|
|
1242
|
+
}), this._getMicrophoneList().then(/*#__PURE__*/function () {
|
|
1243
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(microphoneList) {
|
|
1244
|
+
return _regenerator["default"].wrap(function (_context6) {
|
|
1245
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1246
|
+
case 0:
|
|
1247
|
+
if (!_this6._released) {
|
|
1248
|
+
_context6.next = 1;
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
return _context6.abrupt("return");
|
|
1252
|
+
case 1:
|
|
1253
|
+
_this6.microphoneList = microphoneList;
|
|
1254
|
+
_this6.logger.info("[FcrDeviceStore] init microphone list: ".concat((0, _imports.jsonstring)(microphoneList)));
|
|
1255
|
+
if (_this6.microphoneList.length > 0) {
|
|
1256
|
+
// 默认跟随系统
|
|
1257
|
+
_this6.setMicrophoneId(DEFAULT_DEVICE_ID);
|
|
1258
|
+
}
|
|
1259
|
+
case 2:
|
|
1260
|
+
case "end":
|
|
1261
|
+
return _context6.stop();
|
|
1262
|
+
}
|
|
1263
|
+
}, _callee6);
|
|
1264
|
+
}));
|
|
1265
|
+
return function (_x6) {
|
|
1266
|
+
return _ref3.apply(this, arguments);
|
|
1267
|
+
};
|
|
1268
|
+
}()), this._getSpeakerList().then(/*#__PURE__*/function () {
|
|
1269
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(speakerList) {
|
|
1270
|
+
return _regenerator["default"].wrap(function (_context7) {
|
|
1271
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1272
|
+
case 0:
|
|
1273
|
+
if (!_this6._released) {
|
|
1274
|
+
_context7.next = 1;
|
|
1275
|
+
break;
|
|
1276
|
+
}
|
|
1277
|
+
return _context7.abrupt("return");
|
|
1278
|
+
case 1:
|
|
1279
|
+
_this6.speakerList = speakerList;
|
|
1280
|
+
_this6.logger.info("[FcrDeviceStore] init speaker list: ".concat((0, _imports.jsonstring)(speakerList)));
|
|
1281
|
+
if (_this6.speakerList.length > 0) {
|
|
1282
|
+
// 默认跟随系统
|
|
1283
|
+
_this6.setSpeakerId(DEFAULT_DEVICE_ID);
|
|
1284
|
+
}
|
|
1285
|
+
case 2:
|
|
1286
|
+
case "end":
|
|
1287
|
+
return _context7.stop();
|
|
1288
|
+
}
|
|
1289
|
+
}, _callee7);
|
|
1290
|
+
}));
|
|
1291
|
+
return function (_x7) {
|
|
1292
|
+
return _ref4.apply(this, arguments);
|
|
1293
|
+
};
|
|
1294
|
+
}())]);
|
|
1295
|
+
}
|
|
1296
|
+
}, {
|
|
1297
|
+
key: "_handleMicrophoneAudioTrack",
|
|
1298
|
+
value: function _handleMicrophoneAudioTrack() {
|
|
1299
|
+
if (!this._microphoneAudioTrack) {
|
|
1300
|
+
this.logger.warn('microphone audio track is not set');
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
1303
|
+
if (this.microphoneEnabled) {
|
|
1304
|
+
this._microphoneAudioTrack.start();
|
|
1305
|
+
} else {
|
|
1306
|
+
this._microphoneAudioTrack.stop();
|
|
1307
|
+
this.microphoneVolumeLevel = 0;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}, {
|
|
1311
|
+
key: "_handleMicrophoneEnabledChanged",
|
|
1312
|
+
value: function _handleMicrophoneEnabledChanged() {
|
|
1313
|
+
this._handleMicrophoneAudioTrack();
|
|
1314
|
+
}
|
|
1315
|
+
}, {
|
|
1316
|
+
key: "_handleCameraVideoTrack",
|
|
1317
|
+
value: function _handleCameraVideoTrack() {
|
|
1318
|
+
var enable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.cameraEnabled;
|
|
1319
|
+
var cameraTrack = this._cameraVideoTrack;
|
|
1320
|
+
if (!cameraTrack) {
|
|
1321
|
+
this.logger.warn('camera video track is not set');
|
|
1322
|
+
return;
|
|
1323
|
+
}
|
|
1324
|
+
if (enable) {
|
|
1325
|
+
cameraTrack.start();
|
|
1326
|
+
} else {
|
|
1327
|
+
this._toggleLocalCameraPreview(enable);
|
|
1328
|
+
cameraTrack.stop();
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}, {
|
|
1332
|
+
key: "_handleCameraDeviceIdChanged",
|
|
1333
|
+
value: function _handleCameraDeviceIdChanged() {
|
|
1334
|
+
if (!this._cameraDevice.id) {
|
|
1335
|
+
this.logger.warn('camera id is not set');
|
|
1336
|
+
return;
|
|
1337
|
+
} else {
|
|
1338
|
+
var _this$_cameraVideoTra4, _this$_cameraVideoTra5;
|
|
1339
|
+
(_this$_cameraVideoTra4 = this._cameraVideoTrack) === null || _this$_cameraVideoTra4 === void 0 || _this$_cameraVideoTra4.stopTest();
|
|
1340
|
+
(_this$_cameraVideoTra5 = this._cameraVideoTrack) === null || _this$_cameraVideoTra5 === void 0 || _this$_cameraVideoTra5.stop();
|
|
1341
|
+
this._cameraVideoTrack = this._mediaControl.getCameraTrack(this._cameraDevice.id);
|
|
1342
|
+
this._handleCameraVideoTrack();
|
|
1343
|
+
if (this.showCameraPreview) {
|
|
1344
|
+
this.logger.debug("start camera video track showCameraPreview:".concat(this.showCameraPreview, ",cameraEnabled:").concat(this.cameraEnabled));
|
|
1345
|
+
this._cameraVideoTrack.start();
|
|
1346
|
+
}
|
|
1347
|
+
this._observable.notifyObservers('onCameraChanged', this._cameraDevice.id);
|
|
1348
|
+
}
|
|
1349
|
+
this._toggleLocalCameraPreview(this.showCameraPreview);
|
|
1350
|
+
}
|
|
1351
|
+
}, {
|
|
1352
|
+
key: "_handleSpeakerDetectingChanged",
|
|
1353
|
+
value: function _handleSpeakerDetectingChanged() {
|
|
1354
|
+
var _this7 = this;
|
|
1355
|
+
if (this.microphoneEnabled) {
|
|
1356
|
+
if (this.speakerDetecting) {
|
|
1357
|
+
var _this$_microphoneAudi3;
|
|
1358
|
+
(_this$_microphoneAudi3 = this._microphoneAudioTrack) === null || _this$_microphoneAudi3 === void 0 || _this$_microphoneAudi3.stop();
|
|
1359
|
+
} else {
|
|
1360
|
+
var _this$_microphoneAudi4;
|
|
1361
|
+
(_this$_microphoneAudi4 = this._microphoneAudioTrack) === null || _this$_microphoneAudi4 === void 0 || _this$_microphoneAudi4.start();
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
if (this.speakerDetecting) {
|
|
1365
|
+
var startSelectedSpeakerTest = function startSelectedSpeakerTest() {
|
|
1366
|
+
var _this7$soundEffectLis, _this7$soundEffectLis2;
|
|
1367
|
+
var soundUrl = (0, _env.isElectron)() ? (_this7$soundEffectLis = _this7.soundEffectList.get('speaker_test')) === null || _this7$soundEffectLis === void 0 ? void 0 : _this7$soundEffectLis.md5Url : (_this7$soundEffectLis2 = _this7.soundEffectList.get('speaker_test')) === null || _this7$soundEffectLis2 === void 0 ? void 0 : _this7$soundEffectLis2.url;
|
|
1368
|
+
_this7._mediaControl.startSelectedSpeakerTest(soundUrl || '', _this7._volumeIndicationInterval);
|
|
1369
|
+
};
|
|
1370
|
+
startSelectedSpeakerTest();
|
|
1371
|
+
var sleep = 3000;
|
|
1372
|
+
this._playAudioTimer && clearInterval(this._playAudioTimer);
|
|
1373
|
+
this._playAudioTimer = setInterval(function () {
|
|
1374
|
+
startSelectedSpeakerTest();
|
|
1375
|
+
}, sleep);
|
|
1376
|
+
} else {
|
|
1377
|
+
this._stopSelectedSpeakerTest();
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
}, {
|
|
1381
|
+
key: "_stopSelectedSpeakerTest",
|
|
1382
|
+
value: function _stopSelectedSpeakerTest() {
|
|
1383
|
+
this._playAudioTimer && clearInterval(this._playAudioTimer);
|
|
1384
|
+
this._mediaControl.stopSelectedSpeakerTest();
|
|
1385
|
+
this.speakerVolumeLevel = 0;
|
|
1386
|
+
}
|
|
1387
|
+
}, {
|
|
1388
|
+
key: "_handleMicrophoneDetectingChanged",
|
|
1389
|
+
value: function _handleMicrophoneDetectingChanged() {
|
|
1390
|
+
if (this.microphoneDetecting) {
|
|
1391
|
+
var _this$_microphoneAudi5;
|
|
1392
|
+
(_this$_microphoneAudi5 = this._microphoneAudioTrack) === null || _this$_microphoneAudi5 === void 0 || _this$_microphoneAudi5.startTest(this._volumeIndicationInterval);
|
|
1393
|
+
} else {
|
|
1394
|
+
this._stopMicrophoneTest();
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
}, {
|
|
1398
|
+
key: "_stopMicrophoneTest",
|
|
1399
|
+
value: function _stopMicrophoneTest() {
|
|
1400
|
+
var _this$_microphoneAudi6;
|
|
1401
|
+
(_this$_microphoneAudi6 = this._microphoneAudioTrack) === null || _this$_microphoneAudi6 === void 0 || _this$_microphoneAudi6.stopTest();
|
|
1402
|
+
this.microphoneVolumeLevel = 0;
|
|
1403
|
+
}
|
|
1404
|
+
}, {
|
|
1405
|
+
key: "_handleMicrophoneIdChanged",
|
|
1406
|
+
value: function () {
|
|
1407
|
+
var _handleMicrophoneIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
1408
|
+
return _regenerator["default"].wrap(function (_context8) {
|
|
1409
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
1410
|
+
case 0:
|
|
1411
|
+
if (!this.followSystemMicrophoneDevice) {
|
|
1412
|
+
this._microphoneDevice = {
|
|
1413
|
+
id: this._microphone.id
|
|
1414
|
+
};
|
|
1415
|
+
} else {
|
|
1416
|
+
this._correctSystemSelectedMicrophoneDeviceId();
|
|
1417
|
+
}
|
|
1418
|
+
this._mediaControl.observeSystemSelectedMicrophoneChanged(this.followSystemMicrophoneDevice);
|
|
1419
|
+
case 1:
|
|
1420
|
+
case "end":
|
|
1421
|
+
return _context8.stop();
|
|
1422
|
+
}
|
|
1423
|
+
}, _callee8, this);
|
|
1424
|
+
}));
|
|
1425
|
+
function _handleMicrophoneIdChanged() {
|
|
1426
|
+
return _handleMicrophoneIdChanged2.apply(this, arguments);
|
|
1427
|
+
}
|
|
1428
|
+
return _handleMicrophoneIdChanged;
|
|
1429
|
+
}()
|
|
1430
|
+
}, {
|
|
1431
|
+
key: "_handleMicrophoneDeviceIdChanged",
|
|
1432
|
+
value: function _handleMicrophoneDeviceIdChanged() {
|
|
1433
|
+
if (!this._microphoneDevice.id) {
|
|
1434
|
+
this.logger.debug('setSelectedMicrophone failed');
|
|
1435
|
+
this._microphone.id = DEFAULT_DEVICE_ID;
|
|
1436
|
+
} else {
|
|
1437
|
+
var _this$_microphoneAudi7, _this$_microphoneAudi8;
|
|
1438
|
+
(_this$_microphoneAudi7 = this._microphoneAudioTrack) === null || _this$_microphoneAudi7 === void 0 || _this$_microphoneAudi7.removeObserver(this._microphoneObserver);
|
|
1439
|
+
(_this$_microphoneAudi8 = this._microphoneAudioTrack) === null || _this$_microphoneAudi8 === void 0 || _this$_microphoneAudi8.stop();
|
|
1440
|
+
this._microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
|
|
1441
|
+
this._microphoneAudioTrack.addObserver(this._microphoneObserver);
|
|
1442
|
+
this._handleMicrophoneAudioTrack();
|
|
1443
|
+
this._observable.notifyObservers('onMicrophoneChanged', this._microphoneDevice.id);
|
|
1444
|
+
this.setNoiseLevel(this._sharedSettingDataSource.setting.noiseReduce);
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}, {
|
|
1448
|
+
key: "_handleSpeakerDeviceIdChanged",
|
|
1449
|
+
value: function _handleSpeakerDeviceIdChanged() {
|
|
1450
|
+
if (!this._speakerDevice.id) {
|
|
1451
|
+
this.logger.debug('setSelectedSpeaker failed');
|
|
1452
|
+
this._speaker.id = DEFAULT_DEVICE_ID;
|
|
1453
|
+
} else {
|
|
1454
|
+
this._mediaControl.setSelectedSpeaker(this._speakerDevice.id);
|
|
1455
|
+
this._observable.notifyObservers('onSpeakerChanged', this._speakerDevice.id);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
}, {
|
|
1459
|
+
key: "_handleSpeakerIdChanged",
|
|
1460
|
+
value: function () {
|
|
1461
|
+
var _handleSpeakerIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
1462
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
1463
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1464
|
+
case 0:
|
|
1465
|
+
if (!this.followSystemSpeakerDevice) {
|
|
1466
|
+
this._speakerDevice = {
|
|
1467
|
+
id: this._speaker.id
|
|
1468
|
+
};
|
|
1469
|
+
} else {
|
|
1470
|
+
this._correctSystemSpeakerDeviceId();
|
|
1471
|
+
}
|
|
1472
|
+
this._mediaControl.observeSystemSelectedSpeakerChanged(this.followSystemSpeakerDevice);
|
|
1473
|
+
case 1:
|
|
1474
|
+
case "end":
|
|
1475
|
+
return _context9.stop();
|
|
1476
|
+
}
|
|
1477
|
+
}, _callee9, this);
|
|
1478
|
+
}));
|
|
1479
|
+
function _handleSpeakerIdChanged() {
|
|
1480
|
+
return _handleSpeakerIdChanged2.apply(this, arguments);
|
|
1481
|
+
}
|
|
1482
|
+
return _handleSpeakerIdChanged;
|
|
1483
|
+
}()
|
|
1454
1484
|
}, {
|
|
1455
1485
|
key: "_fetchZipAndUnzip",
|
|
1456
1486
|
value: function () {
|
|
@@ -1551,40 +1581,38 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1551
1581
|
return _correctSystemSelectedMicrophoneDeviceId;
|
|
1552
1582
|
}()
|
|
1553
1583
|
}, {
|
|
1554
|
-
key: "
|
|
1555
|
-
value: function
|
|
1556
|
-
this.
|
|
1584
|
+
key: "_handleSelectedSpeakerVolumeUpdated",
|
|
1585
|
+
value: function _handleSelectedSpeakerVolumeUpdated(volume) {
|
|
1586
|
+
this.speakerVolume = volume;
|
|
1557
1587
|
}
|
|
1558
1588
|
}, {
|
|
1559
|
-
key: "
|
|
1560
|
-
value: function
|
|
1561
|
-
this.
|
|
1589
|
+
key: "_handleSpeakerTestVolumeIndicationUpdated",
|
|
1590
|
+
value: function _handleSpeakerTestVolumeIndicationUpdated(volume) {
|
|
1591
|
+
this.speakerVolumeLevel = getDeviceVolumeLevel(volume);
|
|
1562
1592
|
}
|
|
1563
1593
|
}, {
|
|
1564
1594
|
key: "_handleMicrophoneVolumeIndicationUpdated",
|
|
1565
1595
|
value: function _handleMicrophoneVolumeIndicationUpdated(_, volume) {
|
|
1566
|
-
this.microphoneVolumeLevel =
|
|
1596
|
+
this.microphoneVolumeLevel = getDeviceVolumeLevel(volume);
|
|
1567
1597
|
}
|
|
1568
1598
|
}, {
|
|
1569
|
-
key: "
|
|
1570
|
-
value: function
|
|
1571
|
-
var enabled = this.showCameraPreview;
|
|
1572
|
-
this.toggleLocalCameraPreview(enabled);
|
|
1573
|
-
}
|
|
1574
|
-
}, {
|
|
1575
|
-
key: "toggleLocalCameraPreview",
|
|
1576
|
-
value: function toggleLocalCameraPreview(enabled) {
|
|
1599
|
+
key: "_toggleLocalCameraPreview",
|
|
1600
|
+
value: function _toggleLocalCameraPreview(enabled) {
|
|
1577
1601
|
var _this8 = this;
|
|
1578
1602
|
var localVideoViewSet = this._localVideoViewSet;
|
|
1579
1603
|
var cameraTrack = this._cameraVideoTrack;
|
|
1580
|
-
if (!
|
|
1604
|
+
if (!cameraTrack) {
|
|
1605
|
+
this.logger.warn('camera video track is not set');
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
if (!enabled) {
|
|
1581
1609
|
localVideoViewSet.forEach(function (view) {
|
|
1582
1610
|
cameraTrack.stopPreview(view);
|
|
1583
1611
|
});
|
|
1584
1612
|
}
|
|
1585
1613
|
if (enabled) {
|
|
1586
1614
|
localVideoViewSet.forEach(function (view) {
|
|
1587
|
-
cameraTrack
|
|
1615
|
+
cameraTrack.startPreview({
|
|
1588
1616
|
renderMode: _fcrCore.FcrVideoRenderMode.HIDDEN,
|
|
1589
1617
|
isMirror: _this8.currentIsMirror
|
|
1590
1618
|
}, view);
|
|
@@ -1592,93 +1620,94 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1592
1620
|
}
|
|
1593
1621
|
}
|
|
1594
1622
|
}, {
|
|
1595
|
-
key: "
|
|
1623
|
+
key: "_handleCameraAdded",
|
|
1624
|
+
value: function _handleCameraAdded() {
|
|
1625
|
+
this._handleCameraListUpdated();
|
|
1626
|
+
}
|
|
1627
|
+
}, {
|
|
1628
|
+
key: "_handleCameraRemoved",
|
|
1596
1629
|
value: function () {
|
|
1597
|
-
var
|
|
1630
|
+
var _handleCameraRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11() {
|
|
1598
1631
|
var _this9 = this;
|
|
1599
|
-
var
|
|
1632
|
+
var currentDeviceExist, defaultDeviceId;
|
|
1600
1633
|
return _regenerator["default"].wrap(function (_context11) {
|
|
1601
1634
|
while (1) switch (_context11.prev = _context11.next) {
|
|
1602
1635
|
case 0:
|
|
1603
1636
|
_context11.next = 1;
|
|
1604
|
-
return this.
|
|
1637
|
+
return this._handleCameraListUpdated();
|
|
1605
1638
|
case 1:
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
_this9.
|
|
1639
|
+
currentDeviceExist = this.cameraList.some(function (_ref5) {
|
|
1640
|
+
var deviceId = _ref5.deviceId;
|
|
1641
|
+
return _this9._cameraDevice.id === deviceId;
|
|
1609
1642
|
});
|
|
1610
|
-
currentDeviceExist = false;
|
|
1611
|
-
if (this.cameraId) {
|
|
1612
|
-
currentDeviceExist = this.cameraList.some(function (_ref5) {
|
|
1613
|
-
var deviceId = _ref5.deviceId;
|
|
1614
|
-
return _this9.cameraId === deviceId;
|
|
1615
|
-
});
|
|
1616
|
-
_cameraEnabled = this.cameraEnabled;
|
|
1617
|
-
if (!currentDeviceExist) {
|
|
1618
|
-
this.logger.info('[FcrDeviceStore] current camera is unplugged, close camera');
|
|
1619
|
-
if (this.cameraList.length > 0) {
|
|
1620
|
-
deviceId = this.cameraList[0].deviceId;
|
|
1621
|
-
this.setCameraId(deviceId);
|
|
1622
|
-
} else {
|
|
1623
|
-
this.setCameraId('');
|
|
1624
|
-
}
|
|
1625
|
-
if (_cameraEnabled) {
|
|
1626
|
-
this.setCameraEnabled(false);
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
// select the first camera in the list as default
|
|
1632
1643
|
if (!currentDeviceExist) {
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1644
|
+
this.logger.info('[FcrDeviceStore] current speaker does not exist in speaker list, switch to follow system');
|
|
1645
|
+
defaultDeviceId = this.cameraList.length > 0 ? this.cameraList[0].deviceId : '';
|
|
1646
|
+
this.setCameraId(defaultDeviceId);
|
|
1647
|
+
if (this.cameraEnabled) {
|
|
1648
|
+
this.setCameraEnabled(false);
|
|
1636
1649
|
}
|
|
1637
1650
|
}
|
|
1638
|
-
this._observable.notifyObservers('onCameraListUpdated', this.cameraList);
|
|
1639
1651
|
case 2:
|
|
1640
1652
|
case "end":
|
|
1641
1653
|
return _context11.stop();
|
|
1642
1654
|
}
|
|
1643
1655
|
}, _callee11, this);
|
|
1644
1656
|
}));
|
|
1645
|
-
function
|
|
1646
|
-
return
|
|
1657
|
+
function _handleCameraRemoved() {
|
|
1658
|
+
return _handleCameraRemoved2.apply(this, arguments);
|
|
1647
1659
|
}
|
|
1648
|
-
return
|
|
1660
|
+
return _handleCameraRemoved;
|
|
1649
1661
|
}()
|
|
1650
1662
|
}, {
|
|
1651
|
-
key: "
|
|
1663
|
+
key: "_handleCameraListUpdated",
|
|
1652
1664
|
value: function () {
|
|
1653
|
-
var
|
|
1665
|
+
var _handleCameraListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12() {
|
|
1666
|
+
var cameraList;
|
|
1654
1667
|
return _regenerator["default"].wrap(function (_context12) {
|
|
1655
1668
|
while (1) switch (_context12.prev = _context12.next) {
|
|
1656
1669
|
case 0:
|
|
1657
1670
|
_context12.next = 1;
|
|
1658
|
-
return this.
|
|
1671
|
+
return this._mediaControl.getCameraList();
|
|
1659
1672
|
case 1:
|
|
1673
|
+
cameraList = _context12.sent;
|
|
1674
|
+
this.cameraList = cameraList;
|
|
1675
|
+
this._observable.notifyObservers('onCameraListUpdated', this.cameraList);
|
|
1676
|
+
case 2:
|
|
1660
1677
|
case "end":
|
|
1661
1678
|
return _context12.stop();
|
|
1662
1679
|
}
|
|
1663
1680
|
}, _callee12, this);
|
|
1664
1681
|
}));
|
|
1665
|
-
function
|
|
1666
|
-
return
|
|
1682
|
+
function _handleCameraListUpdated() {
|
|
1683
|
+
return _handleCameraListUpdated2.apply(this, arguments);
|
|
1667
1684
|
}
|
|
1668
|
-
return
|
|
1685
|
+
return _handleCameraListUpdated;
|
|
1669
1686
|
}()
|
|
1687
|
+
}, {
|
|
1688
|
+
key: "_handleMicrophoneAdded",
|
|
1689
|
+
value: function _handleMicrophoneAdded() {
|
|
1690
|
+
this._handleMicrophoneListUpdated();
|
|
1691
|
+
}
|
|
1670
1692
|
}, {
|
|
1671
1693
|
key: "_handleMicrophoneRemoved",
|
|
1672
1694
|
value: function () {
|
|
1673
1695
|
var _handleMicrophoneRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13() {
|
|
1696
|
+
var _this0 = this;
|
|
1697
|
+
var currentDeviceExist;
|
|
1674
1698
|
return _regenerator["default"].wrap(function (_context13) {
|
|
1675
1699
|
while (1) switch (_context13.prev = _context13.next) {
|
|
1676
1700
|
case 0:
|
|
1677
1701
|
_context13.next = 1;
|
|
1678
1702
|
return this._handleMicrophoneListUpdated();
|
|
1679
1703
|
case 1:
|
|
1680
|
-
|
|
1681
|
-
|
|
1704
|
+
currentDeviceExist = this.microphoneList.find(function (item) {
|
|
1705
|
+
return item.deviceId === _this0._microphoneDevice.id;
|
|
1706
|
+
});
|
|
1707
|
+
if (!currentDeviceExist) {
|
|
1708
|
+
this.logger.info('[FcrDeviceStore] current microphone does not exist in microphone list, switch to follow system');
|
|
1709
|
+
this.setMicrophoneId(DEFAULT_DEVICE_ID);
|
|
1710
|
+
}
|
|
1682
1711
|
case 2:
|
|
1683
1712
|
case "end":
|
|
1684
1713
|
return _context13.stop();
|
|
@@ -1691,54 +1720,24 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1691
1720
|
return _handleMicrophoneRemoved;
|
|
1692
1721
|
}()
|
|
1693
1722
|
}, {
|
|
1694
|
-
key: "
|
|
1723
|
+
key: "_handleMicrophoneListUpdated",
|
|
1695
1724
|
value: function () {
|
|
1696
|
-
var
|
|
1697
|
-
var
|
|
1698
|
-
var currentDeviceExist;
|
|
1725
|
+
var _handleMicrophoneListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14() {
|
|
1726
|
+
var microphoneList;
|
|
1699
1727
|
return _regenerator["default"].wrap(function (_context14) {
|
|
1700
1728
|
while (1) switch (_context14.prev = _context14.next) {
|
|
1701
1729
|
case 0:
|
|
1702
|
-
currentDeviceExist = this.microphoneList.find(function (item) {
|
|
1703
|
-
return item.deviceId === _this0._microphoneDevice.id;
|
|
1704
|
-
});
|
|
1705
|
-
if (currentDeviceExist) {
|
|
1706
|
-
_context14.next = 1;
|
|
1707
|
-
break;
|
|
1708
|
-
}
|
|
1709
|
-
this.logger.info('[FcrDeviceStore] current microphone does not exist in microphone list, switch to follow system');
|
|
1710
1730
|
_context14.next = 1;
|
|
1711
|
-
return this.setMicrophoneId(DEFAULT_DEVICE_ID);
|
|
1712
|
-
case 1:
|
|
1713
|
-
case "end":
|
|
1714
|
-
return _context14.stop();
|
|
1715
|
-
}
|
|
1716
|
-
}, _callee14, this);
|
|
1717
|
-
}));
|
|
1718
|
-
function _correctMicrophoneDeviceId() {
|
|
1719
|
-
return _correctMicrophoneDeviceId2.apply(this, arguments);
|
|
1720
|
-
}
|
|
1721
|
-
return _correctMicrophoneDeviceId;
|
|
1722
|
-
}()
|
|
1723
|
-
}, {
|
|
1724
|
-
key: "_handleMicrophoneListUpdated",
|
|
1725
|
-
value: function () {
|
|
1726
|
-
var _handleMicrophoneListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
|
|
1727
|
-
var microphoneList;
|
|
1728
|
-
return _regenerator["default"].wrap(function (_context15) {
|
|
1729
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
1730
|
-
case 0:
|
|
1731
|
-
_context15.next = 1;
|
|
1732
1731
|
return this._getMicrophoneList();
|
|
1733
1732
|
case 1:
|
|
1734
|
-
microphoneList =
|
|
1733
|
+
microphoneList = _context14.sent;
|
|
1735
1734
|
this.microphoneList = microphoneList;
|
|
1736
1735
|
this._observable.notifyObservers('onMicrophoneListUpdated', this.microphoneList);
|
|
1737
1736
|
case 2:
|
|
1738
1737
|
case "end":
|
|
1739
|
-
return
|
|
1738
|
+
return _context14.stop();
|
|
1740
1739
|
}
|
|
1741
|
-
},
|
|
1740
|
+
}, _callee14, this);
|
|
1742
1741
|
}));
|
|
1743
1742
|
function _handleMicrophoneListUpdated() {
|
|
1744
1743
|
return _handleMicrophoneListUpdated2.apply(this, arguments);
|
|
@@ -1747,56 +1746,34 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1747
1746
|
}()
|
|
1748
1747
|
}, {
|
|
1749
1748
|
key: "_handleSpeakerAdded",
|
|
1750
|
-
value: function () {
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
while (1) switch (_context16.prev = _context16.next) {
|
|
1754
|
-
case 0:
|
|
1755
|
-
_context16.next = 1;
|
|
1756
|
-
return this._handleSpeakerListUpdated();
|
|
1757
|
-
case 1:
|
|
1758
|
-
this._observable.notifyObservers('onSpeakerListUpdated', this.speakerList);
|
|
1759
|
-
case 2:
|
|
1760
|
-
case "end":
|
|
1761
|
-
return _context16.stop();
|
|
1762
|
-
}
|
|
1763
|
-
}, _callee16, this);
|
|
1764
|
-
}));
|
|
1765
|
-
function _handleSpeakerAdded() {
|
|
1766
|
-
return _handleSpeakerAdded2.apply(this, arguments);
|
|
1767
|
-
}
|
|
1768
|
-
return _handleSpeakerAdded;
|
|
1769
|
-
}()
|
|
1749
|
+
value: function _handleSpeakerAdded() {
|
|
1750
|
+
this._handleSpeakerListUpdated();
|
|
1751
|
+
}
|
|
1770
1752
|
}, {
|
|
1771
1753
|
key: "_handleSpeakerRemoved",
|
|
1772
1754
|
value: function () {
|
|
1773
|
-
var _handleSpeakerRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1755
|
+
var _handleSpeakerRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
|
|
1774
1756
|
var _this1 = this;
|
|
1775
1757
|
var currentDeviceExist;
|
|
1776
|
-
return _regenerator["default"].wrap(function (
|
|
1777
|
-
while (1) switch (
|
|
1758
|
+
return _regenerator["default"].wrap(function (_context15) {
|
|
1759
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1778
1760
|
case 0:
|
|
1779
|
-
|
|
1761
|
+
_context15.next = 1;
|
|
1780
1762
|
return this._handleSpeakerListUpdated();
|
|
1781
1763
|
case 1:
|
|
1782
1764
|
// 如何设备移除了,应该切到跟随系统
|
|
1783
1765
|
currentDeviceExist = this.speakerList.find(function (item) {
|
|
1784
1766
|
return item.deviceId === _this1._speakerDevice.id;
|
|
1785
1767
|
});
|
|
1786
|
-
if (currentDeviceExist) {
|
|
1787
|
-
|
|
1788
|
-
|
|
1768
|
+
if (!currentDeviceExist) {
|
|
1769
|
+
this.logger.info('[FcrDeviceStore] current speaker does not exist in speaker list, switch to follow system');
|
|
1770
|
+
this.setSpeakerId(DEFAULT_DEVICE_ID);
|
|
1789
1771
|
}
|
|
1790
|
-
this.logger.info('[FcrDeviceStore] current speaker does not exist in speaker list, switch to follow system');
|
|
1791
|
-
_context17.next = 2;
|
|
1792
|
-
return this.setSpeakerId(DEFAULT_DEVICE_ID);
|
|
1793
1772
|
case 2:
|
|
1794
|
-
this._observable.notifyObservers('onSpeakerListUpdated', this.speakerList);
|
|
1795
|
-
case 3:
|
|
1796
1773
|
case "end":
|
|
1797
|
-
return
|
|
1774
|
+
return _context15.stop();
|
|
1798
1775
|
}
|
|
1799
|
-
},
|
|
1776
|
+
}, _callee15, this);
|
|
1800
1777
|
}));
|
|
1801
1778
|
function _handleSpeakerRemoved() {
|
|
1802
1779
|
return _handleSpeakerRemoved2.apply(this, arguments);
|
|
@@ -1806,24 +1783,22 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1806
1783
|
}, {
|
|
1807
1784
|
key: "_handleSpeakerListUpdated",
|
|
1808
1785
|
value: function () {
|
|
1809
|
-
var _handleSpeakerListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1810
|
-
var _this10 = this;
|
|
1786
|
+
var _handleSpeakerListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16() {
|
|
1811
1787
|
var speakerList;
|
|
1812
|
-
return _regenerator["default"].wrap(function (
|
|
1813
|
-
while (1) switch (
|
|
1788
|
+
return _regenerator["default"].wrap(function (_context16) {
|
|
1789
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1814
1790
|
case 0:
|
|
1815
|
-
|
|
1791
|
+
_context16.next = 1;
|
|
1816
1792
|
return this._getSpeakerList();
|
|
1817
1793
|
case 1:
|
|
1818
|
-
speakerList =
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
});
|
|
1794
|
+
speakerList = _context16.sent;
|
|
1795
|
+
this.speakerList = speakerList;
|
|
1796
|
+
this._observable.notifyObservers('onSpeakerListUpdated', this.speakerList);
|
|
1822
1797
|
case 2:
|
|
1823
1798
|
case "end":
|
|
1824
|
-
return
|
|
1799
|
+
return _context16.stop();
|
|
1825
1800
|
}
|
|
1826
|
-
},
|
|
1801
|
+
}, _callee16, this);
|
|
1827
1802
|
}));
|
|
1828
1803
|
function _handleSpeakerListUpdated() {
|
|
1829
1804
|
return _handleSpeakerListUpdated2.apply(this, arguments);
|
|
@@ -1833,60 +1808,26 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1833
1808
|
}, {
|
|
1834
1809
|
key: "_getMicrophoneList",
|
|
1835
1810
|
value: function () {
|
|
1836
|
-
var _getMicrophoneList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1837
|
-
var
|
|
1838
|
-
return _regenerator["default"].wrap(function (
|
|
1839
|
-
while (1) switch (
|
|
1811
|
+
var _getMicrophoneList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17() {
|
|
1812
|
+
var systemSelectedMicrophone, deviceList, formatDeviceList;
|
|
1813
|
+
return _regenerator["default"].wrap(function (_context17) {
|
|
1814
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1840
1815
|
case 0:
|
|
1841
|
-
|
|
1816
|
+
_context17.next = 1;
|
|
1842
1817
|
return this._mediaControl.getSystemSelectedMicrophone();
|
|
1843
1818
|
case 1:
|
|
1844
|
-
|
|
1845
|
-
|
|
1819
|
+
systemSelectedMicrophone = _context17.sent;
|
|
1820
|
+
_context17.next = 2;
|
|
1846
1821
|
return this._mediaControl.getMicrophoneList();
|
|
1847
1822
|
case 2:
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
if (results && results.length > 1) {
|
|
1852
|
-
item.deviceName = results[1];
|
|
1853
|
-
}
|
|
1854
|
-
});
|
|
1855
|
-
|
|
1856
|
-
// 过滤掉虚拟声卡
|
|
1857
|
-
list = list.filter(function (item) {
|
|
1858
|
-
return !(0, _tools.matchVirtualSoundCardPattern)(item.deviceName);
|
|
1859
|
-
});
|
|
1860
|
-
// 加入默认设备
|
|
1861
|
-
defaultIdDevice = list.find(function (item) {
|
|
1862
|
-
return item.deviceId === DEFAULT_DEVICE_ID;
|
|
1863
|
-
}); // 设备列表中没有默认设备,但是系统默认设备存在
|
|
1864
|
-
if (!defaultIdDevice && defaultDevice !== null && defaultDevice !== void 0 && defaultDevice.deviceName) {
|
|
1865
|
-
list.unshift({
|
|
1866
|
-
deviceId: DEFAULT_DEVICE_ID,
|
|
1867
|
-
deviceName: (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
|
|
1868
|
-
reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
|
|
1869
|
-
})
|
|
1870
|
-
});
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
// 设备列表中有默认设备
|
|
1874
|
-
if (defaultIdDevice && defaultIdDevice.deviceName) {
|
|
1875
|
-
defaultIdDevice.deviceName = (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
|
|
1876
|
-
reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
|
|
1877
|
-
});
|
|
1878
|
-
}
|
|
1879
|
-
list.sort(function (a, b) {
|
|
1880
|
-
if (a.deviceId === DEFAULT_DEVICE_ID) return -1;
|
|
1881
|
-
if (b.deviceId === DEFAULT_DEVICE_ID) return 1;
|
|
1882
|
-
return 0;
|
|
1883
|
-
});
|
|
1884
|
-
return _context19.abrupt("return", list);
|
|
1823
|
+
deviceList = _context17.sent;
|
|
1824
|
+
formatDeviceList = this._formatDeviceList(deviceList, systemSelectedMicrophone);
|
|
1825
|
+
return _context17.abrupt("return", formatDeviceList);
|
|
1885
1826
|
case 3:
|
|
1886
1827
|
case "end":
|
|
1887
|
-
return
|
|
1828
|
+
return _context17.stop();
|
|
1888
1829
|
}
|
|
1889
|
-
},
|
|
1830
|
+
}, _callee17, this);
|
|
1890
1831
|
}));
|
|
1891
1832
|
function _getMicrophoneList() {
|
|
1892
1833
|
return _getMicrophoneList2.apply(this, arguments);
|
|
@@ -1896,54 +1837,26 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1896
1837
|
}, {
|
|
1897
1838
|
key: "_getSpeakerList",
|
|
1898
1839
|
value: function () {
|
|
1899
|
-
var _getSpeakerList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1900
|
-
var
|
|
1901
|
-
return _regenerator["default"].wrap(function (
|
|
1902
|
-
while (1) switch (
|
|
1840
|
+
var _getSpeakerList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18() {
|
|
1841
|
+
var systemSelectedSpeaker, deviceList, formatDeviceList;
|
|
1842
|
+
return _regenerator["default"].wrap(function (_context18) {
|
|
1843
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1903
1844
|
case 0:
|
|
1904
|
-
|
|
1845
|
+
_context18.next = 1;
|
|
1905
1846
|
return this._mediaControl.getSystemSelectedSpeaker();
|
|
1906
1847
|
case 1:
|
|
1907
|
-
|
|
1908
|
-
|
|
1848
|
+
systemSelectedSpeaker = _context18.sent;
|
|
1849
|
+
_context18.next = 2;
|
|
1909
1850
|
return this._mediaControl.getSpeakerList();
|
|
1910
1851
|
case 2:
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
if (results && results.length > 1) {
|
|
1915
|
-
item.deviceName = results[1];
|
|
1916
|
-
}
|
|
1917
|
-
});
|
|
1918
|
-
|
|
1919
|
-
// 过滤掉虚拟声卡
|
|
1920
|
-
list = list.filter(function (item) {
|
|
1921
|
-
return !(0, _tools.matchVirtualSoundCardPattern)(item.deviceName);
|
|
1922
|
-
});
|
|
1923
|
-
defaultIdDevice = list.find(function (item) {
|
|
1924
|
-
return item.deviceId === DEFAULT_DEVICE_ID;
|
|
1925
|
-
}); // 设备列表中没有默认设备,但是系统默认设备存在
|
|
1926
|
-
if (!defaultIdDevice && defaultDevice !== null && defaultDevice !== void 0 && defaultDevice.deviceName) {
|
|
1927
|
-
list.unshift({
|
|
1928
|
-
deviceId: DEFAULT_DEVICE_ID,
|
|
1929
|
-
deviceName: (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
|
|
1930
|
-
reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
|
|
1931
|
-
})
|
|
1932
|
-
});
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
// 设备列表中有默认设备
|
|
1936
|
-
if (defaultIdDevice && defaultIdDevice.deviceName) {
|
|
1937
|
-
defaultIdDevice.deviceName = (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
|
|
1938
|
-
reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
|
|
1939
|
-
});
|
|
1940
|
-
}
|
|
1941
|
-
return _context20.abrupt("return", list);
|
|
1852
|
+
deviceList = _context18.sent;
|
|
1853
|
+
formatDeviceList = this._formatDeviceList(deviceList, systemSelectedSpeaker);
|
|
1854
|
+
return _context18.abrupt("return", formatDeviceList);
|
|
1942
1855
|
case 3:
|
|
1943
1856
|
case "end":
|
|
1944
|
-
return
|
|
1857
|
+
return _context18.stop();
|
|
1945
1858
|
}
|
|
1946
|
-
},
|
|
1859
|
+
}, _callee18, this);
|
|
1947
1860
|
}));
|
|
1948
1861
|
function _getSpeakerList() {
|
|
1949
1862
|
return _getSpeakerList2.apply(this, arguments);
|
|
@@ -1951,24 +1864,58 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
1951
1864
|
return _getSpeakerList;
|
|
1952
1865
|
}()
|
|
1953
1866
|
}, {
|
|
1954
|
-
key: "
|
|
1955
|
-
value: function
|
|
1956
|
-
|
|
1867
|
+
key: "_formatDeviceList",
|
|
1868
|
+
value: function _formatDeviceList(deviceList, systemSelectedDevice) {
|
|
1869
|
+
var defaultDeviceName = (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
|
|
1870
|
+
reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
|
|
1871
|
+
});
|
|
1872
|
+
var formatDeviceList = deviceList.reduce(function (deviceList, deviceInfo) {
|
|
1873
|
+
var results = /^default \((.*)\)$/.exec(deviceInfo.deviceName);
|
|
1874
|
+
if (results && results.length > 1) {
|
|
1875
|
+
deviceInfo.deviceName = results[1];
|
|
1876
|
+
}
|
|
1877
|
+
var isNotVirtualSoundCard = !(0, _tools.matchVirtualSoundCardPattern)(deviceInfo.deviceName);
|
|
1878
|
+
if (isNotVirtualSoundCard) {
|
|
1879
|
+
if (deviceInfo.deviceId === DEFAULT_DEVICE_ID) {
|
|
1880
|
+
deviceInfo.deviceName = defaultDeviceName;
|
|
1881
|
+
}
|
|
1882
|
+
deviceList.push(deviceInfo);
|
|
1883
|
+
}
|
|
1884
|
+
return deviceList;
|
|
1885
|
+
}, []);
|
|
1886
|
+
var defaultIdDevice = formatDeviceList.find(function (item) {
|
|
1887
|
+
return item.deviceId === DEFAULT_DEVICE_ID;
|
|
1888
|
+
});
|
|
1889
|
+
|
|
1890
|
+
// 设备列表中没有默认设备,但是系统默认设备存在
|
|
1891
|
+
if (!defaultIdDevice && systemSelectedDevice !== null && systemSelectedDevice !== void 0 && systemSelectedDevice.deviceName) {
|
|
1892
|
+
formatDeviceList.unshift({
|
|
1893
|
+
deviceId: DEFAULT_DEVICE_ID,
|
|
1894
|
+
deviceName: defaultDeviceName
|
|
1895
|
+
});
|
|
1896
|
+
} else {
|
|
1897
|
+
formatDeviceList.sort(function (a, b) {
|
|
1898
|
+
if (a.deviceId === DEFAULT_DEVICE_ID) return -1;
|
|
1899
|
+
if (b.deviceId === DEFAULT_DEVICE_ID) return 1;
|
|
1900
|
+
return 0;
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1903
|
+
return formatDeviceList;
|
|
1957
1904
|
}
|
|
1958
1905
|
}, {
|
|
1959
1906
|
key: "_loadBuiltinResources",
|
|
1960
1907
|
value: function () {
|
|
1961
|
-
var _loadBuiltinResources2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function
|
|
1908
|
+
var _loadBuiltinResources2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19() {
|
|
1962
1909
|
var _window$runtime,
|
|
1963
|
-
|
|
1910
|
+
_this10 = this;
|
|
1964
1911
|
var _yield$window$runtime, virtualBackgroundImages, virtualBackgroundVideos, soundEffects, newVirtualBackgroundList, images, videos, sounds;
|
|
1965
|
-
return _regenerator["default"].wrap(function (
|
|
1966
|
-
while (1) switch (
|
|
1912
|
+
return _regenerator["default"].wrap(function (_context19) {
|
|
1913
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1967
1914
|
case 0:
|
|
1968
|
-
|
|
1915
|
+
_context19.next = 1;
|
|
1969
1916
|
return (_window$runtime = window.runtime) === null || _window$runtime === void 0 ? void 0 : _window$runtime.loadBuiltinResources();
|
|
1970
1917
|
case 1:
|
|
1971
|
-
_yield$window$runtime =
|
|
1918
|
+
_yield$window$runtime = _context19.sent;
|
|
1972
1919
|
virtualBackgroundImages = _yield$window$runtime.virtualBackgroundImages;
|
|
1973
1920
|
virtualBackgroundVideos = _yield$window$runtime.virtualBackgroundVideos;
|
|
1974
1921
|
soundEffects = _yield$window$runtime.soundEffects;
|
|
@@ -2001,16 +1948,16 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
2001
1948
|
newVirtualBackgroundList = newVirtualBackgroundList.concat(images);
|
|
2002
1949
|
newVirtualBackgroundList = newVirtualBackgroundList.concat(videos);
|
|
2003
1950
|
(0, _mobx.runInAction)(function () {
|
|
2004
|
-
|
|
1951
|
+
_this10._updateVirtualBackgroundList(newVirtualBackgroundList);
|
|
2005
1952
|
sounds.forEach(function (item) {
|
|
2006
|
-
|
|
1953
|
+
_this10.soundEffectList.set((0, _tools.getFileNameWithoutExtension)(item.url), item);
|
|
2007
1954
|
});
|
|
2008
1955
|
});
|
|
2009
1956
|
case 2:
|
|
2010
1957
|
case "end":
|
|
2011
|
-
return
|
|
1958
|
+
return _context19.stop();
|
|
2012
1959
|
}
|
|
2013
|
-
},
|
|
1960
|
+
}, _callee19, this);
|
|
2014
1961
|
}));
|
|
2015
1962
|
function _loadBuiltinResources() {
|
|
2016
1963
|
return _loadBuiltinResources2.apply(this, arguments);
|
|
@@ -2020,36 +1967,35 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
|
|
|
2020
1967
|
}]);
|
|
2021
1968
|
}();
|
|
2022
1969
|
_FcrUIDeviceProviderImpl = FcrUIDeviceProviderImpl;
|
|
2023
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIDeviceProviderImpl, [[_mobx.observable, 1, "
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
1970
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIDeviceProviderImpl, [[_mobx.observable, 1, "_microphoneDevice"], [_mobx.observable, 1, "_microphone"], [_mobx.observable, 1, "_speakerDevice"], [_mobx.observable, 1, "_speaker"], [_mobx.observable, 1, "_cameraDevice"], [_mobx.observable, 1, "currentIsMirror"], [_mobx.observable, 1, "showForceOpenEffectDialog"], [_mobx.observable, 1, "cameraEnabled"], [_mobx.observable, 1, "showCameraPreview"], [_mobx.observable, 1, "microphoneEnabled"], [_mobx.observable, 1, "cameraList"], [_mobx.observable, 1, "microphoneList"], [_mobx.observable, 1, "microphoneVolumeLevel"], [_mobx.observable, 1, "speakerList"], [_mobx.observable, 1, "isLocalMirrorEnabled"], [_mobx.observable, 1, "isLocalEditBeautyOptions"], [_mobx.observable, 1, "speakerVolumeLevel"], [_mobx.observable, 1, "speakerVolume"], [_mobx.observable, 1, "microphoneVolume"], [_mobx.observable, 1, "virtualBackgroundName"], [_mobx.observable, 1, "enableBeauty"], [_mobx.observable, 1, "beautyKey"], [_mobx.observable, 1, "beautyOptions"], [_mobx.observable, 1, "virtualBackgroundList"], [_mobx.observable, 1, "soundEffectList"], [_mobx.observable, 1, "microphoneDetecting"], [_mobx.observable, 1, "speakerDetecting"], [_mobx.observable, 1, "connectType"], [_mobx.observable, 1, "isMainRoomAudioOff"], [_imports.bound, 2, "connectAudio"], [_imports.bound, 2, "disconnectAudio"], [_startPlayLocalVideoDecs, 18, "startPlayLocalVideo"], [_stopPlayLocalVideoDecs, 18, "stopPlayLocalVideo"], [_startSpeakerTestDecs, 18, "startSpeakerTest"], [_stopSpeakerTestDecs, 18, "stopSpeakerTest"], [_setCurrentIsMirrorDecs, 18, "setCurrentIsMirror"], [_toggleLocalMirrorPreviewDecs, 18, "toggleLocalMirrorPreview"], [_setBeautyOptionsDecs, 18, "setBeautyOptions"], [_handleCancelForceOpenVideoEffectDecs, 18, "handleCancelForceOpenVideoEffect"], [_handleForceOpenVideoEffectDecs, 18, "handleForceOpenVideoEffect"], [_imports.bound, 2, "setVideoOrientation"], [_setCameraEnabledDecs, 18, "setCameraEnabled"], [_handleCameraEnabledChangedDecs, 18, "_handleCameraEnabledChanged"], [_setMicrophoneEnabledDecs, 18, "setMicrophoneEnabled"], [_toggleLocalMirrorDecs, 18, "toggleLocalMirror"], [_resetMirrorDecs, 18, "resetMirror"], [_startMicrophoneTestDecs, 18, "startMicrophoneTest"], [_stopMicrophoneTestDecs, 18, "stopMicrophoneTest"], [_enableVirtualBackgroundDecs, 18, "enableVirtualBackground"], [_setEditBeautyKeyDecs, 18, "setEditBeautyKey"], [_enableBeautyEffectDecs, 18, "enableBeautyEffect"], [_setCameraIdDecs, 18, "setCameraId"], [_setMainRoomAudioOffDecs, 18, "setMainRoomAudioOff"], [_setSpeakerIdDecs, 18, "setSpeakerId"], [_setMicrophoneIdDecs, 18, "setMicrophoneId"], [_setSpeakerVolumeDecs, 18, "setSpeakerVolume"], [_setMicrophoneVolumeDecs, 18, "setMicrophoneVolume"], [_startOrStopCameraDecs, 18, "startOrStopCamera"], [_setShowCameraPreviewDecs, 18, "setShowCameraPreview"], [_loadUiResourcesDecs, 18, "loadUiResources"], [_loadZipResourcesDecs, 18, "loadZipResources"], [_imports.bound, 2, "toggleAGC"], [_setConnectTypeDecs, 18, "setConnectType"], [_toggleLocalCameraPreviewDecs, 18, "toggleLocalCameraPreview"], [_getLoopbackDeviceIdDecs, 18, "getLoopbackDeviceId"], [_initDeviceListDecs, 18, "_initDeviceList"], [_handleMicrophoneAudioTrackDecs, 18, "_handleMicrophoneAudioTrack"], [_handleMicrophoneEnabledChangedDecs, 18, "_handleMicrophoneEnabledChanged"], [_handleCameraVideoTrackDecs, 18, "_handleCameraVideoTrack"], [_imports.bound, 2, "_handleCameraDeviceIdChanged"], [_handleSpeakerDetectingChangedDecs, 18, "_handleSpeakerDetectingChanged"], [_stopSelectedSpeakerTestDecs, 18, "_stopSelectedSpeakerTest"], [_handleMicrophoneDetectingChangedDecs, 18, "_handleMicrophoneDetectingChanged"], [_stopMicrophoneTestDecs2, 18, "_stopMicrophoneTest"], [_imports.bound, 2, "_handleMicrophoneIdChanged"], [_imports.bound, 2, "_handleMicrophoneDeviceIdChanged"], [_imports.bound, 2, "_handleSpeakerDeviceIdChanged"], [_imports.bound, 2, "_handleSpeakerIdChanged"], [_updateVirtualBackgroundListDecs, 18, "_updateVirtualBackgroundList"], [_handleSystemSelectedSpeakerChangedDecs, 18, "_handleSystemSelectedSpeakerChanged"], [_handleSystemSelectedMicrophoneChangedDecs, 18, "_handleSystemSelectedMicrophoneChanged"], [_correctSystemSelectedMicrophoneDeviceIdDecs, 18, "_correctSystemSelectedMicrophoneDeviceId"], [_handleSelectedSpeakerVolumeUpdatedDecs, 18, "_handleSelectedSpeakerVolumeUpdated"], [_handleSpeakerTestVolumeIndicationUpdatedDecs, 18, "_handleSpeakerTestVolumeIndicationUpdated"], [_handleMicrophoneVolumeIndicationUpdatedDecs, 18, "_handleMicrophoneVolumeIndicationUpdated"], [_imports.bound, 2, "_toggleLocalCameraPreview"], [_imports.bound, 2, "_handleCameraAdded"], [_imports.bound, 2, "_handleCameraRemoved"], [_imports.bound, 2, "_handleCameraListUpdated"], [_imports.bound, 2, "_handleMicrophoneAdded"], [_imports.bound, 2, "_handleMicrophoneRemoved"], [_imports.bound, 2, "_handleMicrophoneListUpdated"], [_handleSpeakerAddedDecs, 18, "_handleSpeakerAdded"], [_handleSpeakerRemovedDecs, 18, "_handleSpeakerRemoved"], [_handleSpeakerListUpdatedDecs, 18, "_handleSpeakerListUpdated"], [_getMicrophoneListDecs, 18, "_getMicrophoneList"], [_getSpeakerListDecs, 18, "_getSpeakerList"], [_formatDeviceListDecs, 18, "_formatDeviceList"], [_loadBuiltinResourcesDecs, 18, "_loadBuiltinResources"]], []).e, 30);
|
|
1971
|
+
_init__microphoneDevice = _applyDecs$e[0];
|
|
1972
|
+
_init__microphone = _applyDecs$e[1];
|
|
1973
|
+
_init__speakerDevice = _applyDecs$e[2];
|
|
1974
|
+
_init__speaker = _applyDecs$e[3];
|
|
1975
|
+
_init__cameraDevice = _applyDecs$e[4];
|
|
2029
1976
|
_init_currentIsMirror = _applyDecs$e[5];
|
|
2030
1977
|
_init_showForceOpenEffectDialog = _applyDecs$e[6];
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
_initProto = _applyDecs$e[30];
|
|
1978
|
+
_init_cameraEnabled = _applyDecs$e[7];
|
|
1979
|
+
_init_showCameraPreview = _applyDecs$e[8];
|
|
1980
|
+
_init_microphoneEnabled = _applyDecs$e[9];
|
|
1981
|
+
_init_cameraList = _applyDecs$e[10];
|
|
1982
|
+
_init_microphoneList = _applyDecs$e[11];
|
|
1983
|
+
_init_microphoneVolumeLevel = _applyDecs$e[12];
|
|
1984
|
+
_init_speakerList = _applyDecs$e[13];
|
|
1985
|
+
_init_isLocalMirrorEnabled = _applyDecs$e[14];
|
|
1986
|
+
_init_isLocalEditBeautyOptions = _applyDecs$e[15];
|
|
1987
|
+
_init_speakerVolumeLevel = _applyDecs$e[16];
|
|
1988
|
+
_init_speakerVolume = _applyDecs$e[17];
|
|
1989
|
+
_init_microphoneVolume = _applyDecs$e[18];
|
|
1990
|
+
_init_virtualBackgroundName = _applyDecs$e[19];
|
|
1991
|
+
_init_enableBeauty = _applyDecs$e[20];
|
|
1992
|
+
_init_beautyKey = _applyDecs$e[21];
|
|
1993
|
+
_init_beautyOptions = _applyDecs$e[22];
|
|
1994
|
+
_init_virtualBackgroundList = _applyDecs$e[23];
|
|
1995
|
+
_init_soundEffectList = _applyDecs$e[24];
|
|
1996
|
+
_init_microphoneDetecting = _applyDecs$e[25];
|
|
1997
|
+
_init_speakerDetecting = _applyDecs$e[26];
|
|
1998
|
+
_init_connectType = _applyDecs$e[27];
|
|
1999
|
+
_init_isMainRoomAudioOff = _applyDecs$e[28];
|
|
2000
|
+
_initProto = _applyDecs$e[29];
|
|
2055
2001
|
(0, _base.registerDependency)('deviceProvider');
|