Bladeren bron

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

j8
tudordan7 3 jaren geleden
bovenliggende
commit
748a84eeef

+ 8
- 2
css/modals/virtual-background/_virtual-background.scss Bestand weergeven

220
  }
220
  }
221
 
221
 
222
  .video-background-preview-entry{
222
  .video-background-preview-entry{
223
-    margin-left:5px;
223
+    margin-left: -10px;
224
     height: 250px;
224
     height: 250px;
225
-    width: 94%;
225
+    max-width: 95.4%;
226
     margin-bottom: 8px;
226
     margin-bottom: 8px;
227
     position: absolute;
227
     position: absolute;
228
     z-index: 2;
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
  .virtual-background-preview-video{
237
  .virtual-background-preview-video{

+ 28
- 1
react/features/toolbox/components/web/Toolbox.js Bestand weergeven

74
     VideoQualityDialog
74
     VideoQualityDialog
75
 } from '../../../video-quality';
75
 } from '../../../video-quality';
76
 import { VideoBackgroundButton } from '../../../virtual-background';
76
 import { VideoBackgroundButton } from '../../../virtual-background';
77
+import { toggleBackgroundEffect } from '../../../virtual-background/actions';
77
 import { checkBlurSupport } from '../../../virtual-background/functions';
78
 import { checkBlurSupport } from '../../../virtual-background/functions';
78
 import {
79
 import {
79
     setFullScreen,
80
     setFullScreen,
183
      */
184
      */
184
     _locked: boolean,
185
     _locked: boolean,
185
 
186
 
187
+    /**
188
+     * The JitsiLocalTrack to display.
189
+     */
190
+    _localVideo: Object,
191
+
186
     /**
192
     /**
187
      * Whether or not the overflow menu is visible.
193
      * Whether or not the overflow menu is visible.
188
      */
194
      */
223
      */
229
      */
224
      _shouldShowButton: Function,
230
      _shouldShowButton: Function,
225
 
231
 
232
+    /**
233
+     * Returns the selected virtual source object.
234
+     */
235
+     _virtualSource: Object,
236
+
226
     /**
237
     /**
227
      * Invoked to active other features of the app.
238
      * Invoked to active other features of the app.
228
      */
239
      */
896
      * @returns {void}
907
      * @returns {void}
897
      */
908
      */
898
     _onToolbarToggleScreenshare() {
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
             return;
925
             return;
901
         }
926
         }
902
 
927
 
1377
         _conference: conference,
1402
         _conference: conference,
1378
         _desktopSharingEnabled: desktopSharingEnabled,
1403
         _desktopSharingEnabled: desktopSharingEnabled,
1379
         _backgroundType: state['features/virtual-background'].backgroundType,
1404
         _backgroundType: state['features/virtual-background'].backgroundType,
1405
+        _virtualSource: state['features/virtual-background'].virtualSource,
1380
         _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
1406
         _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
1381
         _dialog: Boolean(state['features/base/dialog'].component),
1407
         _dialog: Boolean(state['features/base/dialog'].component),
1382
         _feedbackConfigured: Boolean(callStatsID),
1408
         _feedbackConfigured: Boolean(callStatsID),
1386
         _fullScreen: fullScreen,
1412
         _fullScreen: fullScreen,
1387
         _tileViewEnabled: shouldDisplayTileView(state),
1413
         _tileViewEnabled: shouldDisplayTileView(state),
1388
         _localParticipantID: localParticipant.id,
1414
         _localParticipantID: localParticipant.id,
1415
+        _localVideo: localVideo,
1389
         _localRecState: localRecordingStates,
1416
         _localRecState: localRecordingStates,
1390
         _locked: locked,
1417
         _locked: locked,
1391
         _overflowMenuVisible: overflowMenuVisible,
1418
         _overflowMenuVisible: overflowMenuVisible,

Laden…
Annuleren
Opslaan