From 78047eb68eac74d81dd17902e28115b37faa9066 Mon Sep 17 00:00:00 2001 From: Arthur <32987232+Arthurk12@users.noreply.github.com> Date: Fri, 11 Jun 2021 14:55:57 -0300 Subject: [PATCH] feat(video): data savings Enable video sharing when data savings is activated. --- .../imports/ui/components/media/component.jsx | 9 ++------- .../imports/ui/components/media/container.jsx | 5 ++--- .../media/webcam-draggable-overlay/component.jsx | 6 +----- .../imports/ui/components/video-provider/service.js | 9 ++++++++- .../components/video-provider/video-button/component.jsx | 4 ---- bigbluebutton-html5/public/locales/en.json | 3 +-- 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/media/component.jsx b/bigbluebutton-html5/imports/ui/components/media/component.jsx index 4e578bb18d..7e9ae20a6b 100644 --- a/bigbluebutton-html5/imports/ui/components/media/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/component.jsx @@ -2,7 +2,6 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import cx from 'classnames'; import deviceInfo from '/imports/utils/deviceInfo'; -import Settings from '/imports/ui/services/settings'; import WebcamDraggable from './webcam-draggable-overlay/component'; import { styles } from './styles'; import Storage from '../../services/storage/session'; @@ -15,7 +14,6 @@ const propTypes = { singleWebcam: PropTypes.bool.isRequired, hideOverlay: PropTypes.bool, swapLayout: PropTypes.bool, - disableVideo: PropTypes.bool, audioModalIsOpen: PropTypes.bool, layoutContextState: PropTypes.instanceOf(Object).isRequired, }; @@ -24,7 +22,6 @@ const defaultProps = { usersVideo: [], hideOverlay: true, swapLayout: false, - disableVideo: false, audioModalIsOpen: false, }; @@ -40,7 +37,6 @@ export default class Media extends Component { swapLayout, singleWebcam, hideOverlay, - disableVideo, children, audioModalIsOpen, usersVideo, @@ -67,8 +63,8 @@ export default class Media extends Component { [styles.containerV]: webcamsPlacement === 'top' || webcamsPlacement === 'bottom' || webcamsPlacement === 'floating', [styles.containerH]: webcamsPlacement === 'left' || webcamsPlacement === 'right', }); - const { viewParticipantsWebcams } = Settings.dataSaving; - const showVideo = usersVideo.length > 0 && viewParticipantsWebcams && isMeteorConnected; + + const showVideo = usersVideo.length > 0 && isMeteorConnected; return (
diff --git a/bigbluebutton-html5/imports/ui/components/media/container.jsx b/bigbluebutton-html5/imports/ui/components/media/container.jsx index 0c6cda22f9..675c3c9a87 100755 --- a/bigbluebutton-html5/imports/ui/components/media/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/container.jsx @@ -65,7 +65,7 @@ let userWasInBreakout = false; export default withLayoutConsumer(withModalMounter(withTracker(() => { const { dataSaving } = Settings; - const { viewParticipantsWebcams, viewScreenshare } = dataSaving; + const { viewScreenshare } = dataSaving; const hidePresentation = getFromUserSettings('bbb_hide_presentation', LAYOUT_CONFIG.hidePresentation); const autoSwapLayout = getFromUserSettings('bbb_auto_swap_layout', LAYOUT_CONFIG.autoSwapLayout); const { current_presentation: hasPresentation } = MediaService.getPresentationInfo(); @@ -112,7 +112,7 @@ export default withLayoutConsumer(withModalMounter(withTracker(() => { const { streams: usersVideo } = VideoService.getVideoStreams(); data.usersVideo = usersVideo; - if (MediaService.shouldShowOverlay() && usersVideo.length && viewParticipantsWebcams) { + if (MediaService.shouldShowOverlay() && usersVideo.length) { data.floatingOverlay = usersVideo.length < 2; data.hideOverlay = usersVideo.length === 0; } @@ -121,7 +121,6 @@ export default withLayoutConsumer(withModalMounter(withTracker(() => { data.isScreensharing = MediaService.isVideoBroadcasting(); data.swapLayout = (getSwapLayout() || !hasPresentation) && shouldEnableSwapLayout(); - data.disableVideo = !viewParticipantsWebcams; if (data.swapLayout) { data.floatingOverlay = true; diff --git a/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx b/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx index bf32aa466b..22ddec1f49 100644 --- a/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/webcam-draggable-overlay/component.jsx @@ -14,7 +14,6 @@ import { WEBCAMSAREA_MIN_PERCENT, PRESENTATIONAREA_MIN_WIDTH } from '/imports/ui const propTypes = { swapLayout: PropTypes.bool, hideOverlay: PropTypes.bool, - disableVideo: PropTypes.bool, audioModalIsOpen: PropTypes.bool, webcamDraggableState: PropTypes.objectOf(Object).isRequired, webcamDraggableDispatch: PropTypes.func.isRequired, @@ -26,7 +25,6 @@ const propTypes = { const defaultProps = { swapLayout: false, hideOverlay: false, - disableVideo: false, audioModalIsOpen: false, refMediaContainer: null, }; @@ -280,7 +278,6 @@ class WebcamDraggable extends PureComponent { webcamDraggableState, swapLayout, hideOverlay, - disableVideo, audioModalIsOpen, } = this.props; @@ -494,8 +491,7 @@ class WebcamDraggable extends PureComponent { }} > { - !disableVideo - && !audioModalIsOpen + !audioModalIsOpen ? (