diff --git a/bigbluebutton-html5/imports/ui/components/media/container.jsx b/bigbluebutton-html5/imports/ui/components/media/container.jsx old mode 100644 new mode 100755 index 36fcea2849..b0ee087a16 --- a/bigbluebutton-html5/imports/ui/components/media/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/media/container.jsx @@ -1,8 +1,6 @@ import React, { Component } from 'react'; import { withTracker } from 'meteor/react-meteor-data'; import Settings from '/imports/ui/services/settings'; -import Meetings from '/imports/api/meetings/'; -import Auth from '/imports/ui/services/auth'; import { defineMessages, injectIntl } from 'react-intl'; import { notify } from '/imports/ui/services/notification'; import Media from './component'; @@ -85,9 +83,6 @@ export default withTracker(() => { const data = {}; data.currentPresentation = MediaService.getPresentationInfo(); - const meeting = Meetings.findOne({ meetingId: Auth.meetingID }); - const webcamOnlyModerator = meeting.usersProp.webcamsOnlyForModerator; - data.content = ; if (MediaService.shouldShowWhiteboard()) { @@ -98,7 +93,7 @@ export default withTracker(() => { data.content = ; } - if (MediaService.shouldShowOverlay() && viewParticipantsWebcams && !webcamOnlyModerator) { + if (MediaService.shouldShowOverlay() && viewParticipantsWebcams) { data.overlay = ; } diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx index fb9335de36..c2d653f0e7 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-dock/component.jsx @@ -86,11 +86,11 @@ class VideoDock extends Component {
{this.props.users.map(user => ( {children}; -export default withTracker(({sharedWebcam}) => { +export default withTracker(({ sharedWebcam }) => { const meeting = Meetings.findOne({ meetingId: Auth.meetingID }); const lockCam = meeting.lockSettingsProp ? meeting.lockSettingsProp.disableCam : false; const userId = Auth.userID; - const user = Users.findOne({ userId }); - const userLocked = mapUser(user).isLocked; + const currentUser = Users.findOne({ userId }); + const currentUserIsModerator = mapUser(currentUser).isModerator; - const withActiveStreams = (users) => { - const activeFilter = (user) => { - const isLocked = lockCam && user.locked; - return !isLocked && (user.has_stream || (sharedWebcam && user.userId == userId)); - }; + const isSharingWebcam = user => user.isSharingWebcam || (sharedWebcam && user.isCurrent); + const isNotLocked = user => !(lockCam && user.isLocked); - return users.filter(activeFilter); - } - const users = withActiveStreams(VideoService.getAllUsers()); + const isWebcamOnlyModerator = VideoService.webcamOnlyModerator(); + const allowedSeeViewersWebcams = !isWebcamOnlyModerator || currentUserIsModerator; + const webcamOnlyModerator = (user) => { + if (allowedSeeViewersWebcams) return true; + return user.isModerator || user.isCurrent; + }; + + const users = VideoService.getAllUsers() + .map(mapUser) + .filter(isSharingWebcam) + .filter(isNotLocked) + .filter(webcamOnlyModerator); return { users, - userId + userId, }; })(VideoDockContainer); diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/container.jsx b/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/container.jsx index 36ded78826..99c3ee854e 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/container.jsx @@ -46,7 +46,7 @@ const JoinVideoOptionsContainer = (props) => { iconPath: `${baseName}/resources/images/video-menu/icon-webcam-off.svg`, description: intl.formatMessage(intlMessages[isSharingVideo ? 'leaveVideo' : 'joinVideo']), label: intl.formatMessage(intlMessages[isSharingVideo ? 'leaveVideo' : 'joinVideo']), - disabled: isDisabled, + disabled: isDisabled && !isSharingVideo, click: isSharingVideo ? handleCloseVideo : handleJoinVideo, }, ]; diff --git a/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/service.js b/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/service.js index ec1f30b6e9..3ff6a88aba 100755 --- a/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/service.js +++ b/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/service.js @@ -19,12 +19,14 @@ const isDisabled = () => { const videoSettings = Settings.dataSaving; const enableShare = videoSettings.viewParticipantsWebcams; const lockCam = VideoService.isLocked(); - const webcamOnlyModerator = VideoService.webcamOnlyModerator(); + const user = Users.findOne({ userId: Auth.userID }); const userLocked = mapUser(user).isLocked; const isConnecting = (!isSharingVideo && isConnected); - const isLocked = (lockCam && userLocked) || webcamOnlyModerator; + + + const isLocked = (lockCam && userLocked); return isLocked || isWaitingResponse diff --git a/bigbluebutton-html5/imports/ui/services/user/mapUser.js b/bigbluebutton-html5/imports/ui/services/user/mapUser.js old mode 100644 new mode 100755 index e9012f88e9..92a45639ee --- a/bigbluebutton-html5/imports/ui/services/user/mapUser.js +++ b/bigbluebutton-html5/imports/ui/services/user/mapUser.js @@ -26,7 +26,7 @@ const mapUser = (user) => { isMuted: voiceUser ? voiceUser.muted : false, isTalking: voiceUser ? voiceUser.talking : false, isListenOnly: voiceUser ? voiceUser.listenOnly : false, - isSharingWebcam: 0, + isSharingWebcam: user.has_stream, isPhoneUser: user.phone_user, isOnline: user.connectionStatus === 'online', };