diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx index e55b04a5705654140c75b1daba1f492a2c62a203..068d0127e2ac5a2f50e8a299fb3d4b6f5cabc943 100755 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/component.jsx @@ -10,32 +10,6 @@ import CaptionsButtonContainer from '/imports/ui/components/actions-bar/captions import PresentationOptionsContainer from './presentation-options/component'; class ActionsBar extends PureComponent { - componentDidUpdate(prevProps) { - const { isThereCurrentPresentation: prevIsThereCurrPresentation } = prevProps; - const { - isThereCurrentPresentation, - getSwapLayout, - toggleSwapLayout, - isSharingVideo, - isVideoBroadcasting, - } = this.props; - - // TODO: THIS BREAKS AUTO SWAP BIGLY AND SHOULD BE FIXED IN MEDIA CONTAINER - // if (!isThereCurrentPresentation && !isSharingVideo && !isVideoBroadcasting) { - // if (!getSwapLayout()) { - // toggleSwapLayout(); - // } - // } - - // if (!prevIsThereCurrPresentation - // && isThereCurrentPresentation - // && !isSharingVideo - // && !isVideoBroadcasting) { - // if (getSwapLayout()) { - // toggleSwapLayout(); - // } - // } - } render() { const { @@ -62,10 +36,10 @@ class ActionsBar extends PureComponent { isMeteorConnected, isPollingEnabled, isThereCurrentPresentation, + allowExternalVideo, } = this.props; const actionBarClasses = {}; - const { enabled: enableExternalVideo } = Meteor.settings.public.externalVideoPlayer; actionBarClasses[styles.centerWithActions] = amIPresenter; actionBarClasses[styles.center] = true; @@ -77,7 +51,7 @@ class ActionsBar extends PureComponent { amIPresenter, amIModerator, isPollingEnabled, - allowExternalVideo: enableExternalVideo, + allowExternalVideo, handleTakePresenter, intl, isSharingVideo, diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/container.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/container.jsx index 16b06c76cfd48cc859f6c9570d877d6b911897b1..d11bec37200b0671c60c203115d8ffb4dece3f48 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/container.jsx @@ -51,5 +51,5 @@ export default withTracker(() => ({ isPollingEnabled: POLLING_ENABLED, isThereCurrentPresentation: Presentations.findOne({ meetingId: Auth.meetingID, current: true }, { fields: {} }), - getSwapLayout, + allowExternalVideo: Meteor.settings.public.externalVideoPlayer.enabled, }))(injectIntl(ActionsBarContainer)); diff --git a/bigbluebutton-html5/imports/ui/components/external-video-player/modal/component.jsx b/bigbluebutton-html5/imports/ui/components/external-video-player/modal/component.jsx index d93b2158452cf8a8e0a866bf3693ceff2b8a01fc..4d74ed7759abe1504bb5376e36da37bc1693c443 100644 --- a/bigbluebutton-html5/imports/ui/components/external-video-player/modal/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/external-video-player/modal/component.jsx @@ -60,7 +60,6 @@ class ExternalVideoModal extends Component { const { startWatching, closeModal, - isSwapped, } = this.props; const { url } = this.state; diff --git a/bigbluebutton-html5/imports/ui/components/media/container.jsx b/bigbluebutton-html5/imports/ui/components/media/container.jsx index a049c4d6e469ae5f35e81433670af0248c7179d1..9220e4e019a2f26ac5ef3ba74492de8de6d5087d 100755 --- a/bigbluebutton-html5/imports/ui/components/media/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/container.jsx @@ -105,6 +105,7 @@ export default withModalMounter(withTracker(() => { const { dataSaving } = Settings; const { viewParticipantsWebcams, viewScreenshare } = dataSaving; const hidePresentation = getFromUserSettings('hidePresentation', LAYOUT_CONFIG.hidePresentation); + const { current_presentation: hasPresentation } = MediaService.getPresentationInfo(); const data = { children: <DefaultContent />, audioModalIsOpen: Session.get('audioModalIsOpen'), @@ -130,7 +131,7 @@ export default withModalMounter(withTracker(() => { } data.isScreensharing = MediaService.isVideoBroadcasting(); - data.swapLayout = getSwapLayout() && shouldEnableSwapLayout(); + data.swapLayout = (getSwapLayout() || !hasPresentation) && shouldEnableSwapLayout(); data.disableVideo = !viewParticipantsWebcams; if (data.swapLayout) { diff --git a/bigbluebutton-html5/imports/ui/components/media/service.js b/bigbluebutton-html5/imports/ui/components/media/service.js index 1e03deafcafe009937fc39b7809e4668bfdf7cd6..56a0accc837bbce8ed272087133048e444f680e0 100755 --- a/bigbluebutton-html5/imports/ui/components/media/service.js +++ b/bigbluebutton-html5/imports/ui/components/media/service.js @@ -62,10 +62,13 @@ export const shouldEnableSwapLayout = () => { const { viewParticipantsWebcams } = Settings.dataSaving; const usersVideo = VideoService.getAllWebcamUsers(); const poll = PollingService.mapPolls(); + const { current_presentation: hasPresentation } = getPresentationInfo(); return usersVideo.length > 0 // prevent swap without any webcams && viewParticipantsWebcams // prevent swap when dataSaving for webcams is enabled - && !poll.pollExists; // prevent swap when there is a poll running + && !poll.pollExists // prevent swap when there is a poll running + && !shouldShowScreenshare() // and when there's screenshare + && !shouldShowExternalVideo() // or there's an external video }; export const getSwapLayout = () => {