Pārlūkot izejas kodu

feat(virtual-background): Desktop share as virtual background

j8
tudordan7 3 gadus atpakaļ
vecāks
revīzija
748a84eeef

+ 8
- 2
css/modals/virtual-background/_virtual-background.scss Parādīt failu

@@ -220,12 +220,18 @@
220 220
  }
221 221
 
222 222
  .video-background-preview-entry{
223
-    margin-left:5px;
223
+    margin-left: -10px;
224 224
     height: 250px;
225
-    width: 94%;
225
+    max-width: 95.4%;
226 226
     margin-bottom: 8px;
227 227
     position: absolute;
228 228
     z-index: 2;
229
+    @media (min-width: 432px) and (max-width: 632px) {
230
+        max-width: 336;
231
+    }
232
+    @media (max-width: 432px){
233
+        max-width: 336;
234
+    }
229 235
  }
230 236
 
231 237
  .virtual-background-preview-video{

+ 28
- 1
react/features/toolbox/components/web/Toolbox.js Parādīt failu

@@ -74,6 +74,7 @@ import {
74 74
     VideoQualityDialog
75 75
 } from '../../../video-quality';
76 76
 import { VideoBackgroundButton } from '../../../virtual-background';
77
+import { toggleBackgroundEffect } from '../../../virtual-background/actions';
77 78
 import { checkBlurSupport } from '../../../virtual-background/functions';
78 79
 import {
79 80
     setFullScreen,
@@ -183,6 +184,11 @@ type Props = {
183 184
      */
184 185
     _locked: boolean,
185 186
 
187
+    /**
188
+     * The JitsiLocalTrack to display.
189
+     */
190
+    _localVideo: Object,
191
+
186 192
     /**
187 193
      * Whether or not the overflow menu is visible.
188 194
      */
@@ -223,6 +229,11 @@ type Props = {
223 229
      */
224 230
      _shouldShowButton: Function,
225 231
 
232
+    /**
233
+     * Returns the selected virtual source object.
234
+     */
235
+     _virtualSource: Object,
236
+
226 237
     /**
227 238
      * Invoked to active other features of the app.
228 239
      */
@@ -896,7 +907,21 @@ class Toolbox extends Component<Props> {
896 907
      * @returns {void}
897 908
      */
898 909
     _onToolbarToggleScreenshare() {
899
-        if (!this.props._desktopSharingEnabled || this.props._backgroundType === 'desktop-share') {
910
+        if (this.props._backgroundType === 'desktop-share') {
911
+            const noneOptions = {
912
+                enabled: false,
913
+                backgroundType: 'none',
914
+                selectedThumbnail: 'none',
915
+                backgroundEffectEnabled: false
916
+            };
917
+
918
+            this.props._virtualSource.dispose();
919
+
920
+            this.props.dispatch(toggleBackgroundEffect(noneOptions, this.props._localVideo));
921
+
922
+            return;
923
+        }
924
+        if (!this.props._desktopSharingEnabled) {
900 925
             return;
901 926
         }
902 927
 
@@ -1377,6 +1402,7 @@ function _mapStateToProps(state) {
1377 1402
         _conference: conference,
1378 1403
         _desktopSharingEnabled: desktopSharingEnabled,
1379 1404
         _backgroundType: state['features/virtual-background'].backgroundType,
1405
+        _virtualSource: state['features/virtual-background'].virtualSource,
1380 1406
         _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
1381 1407
         _dialog: Boolean(state['features/base/dialog'].component),
1382 1408
         _feedbackConfigured: Boolean(callStatsID),
@@ -1386,6 +1412,7 @@ function _mapStateToProps(state) {
1386 1412
         _fullScreen: fullScreen,
1387 1413
         _tileViewEnabled: shouldDisplayTileView(state),
1388 1414
         _localParticipantID: localParticipant.id,
1415
+        _localVideo: localVideo,
1389 1416
         _localRecState: localRecordingStates,
1390 1417
         _locked: locked,
1391 1418
         _overflowMenuVisible: overflowMenuVisible,

Notiek ielāde…
Atcelt
Saglabāt