Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/CallView/shared/VideoVue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import TransitionWrapper from '../../UIShared/TransitionWrapper.vue'
import Screen from './Screen.vue'
import VideoBackground from './VideoBackground.vue'
import VideoBottomBar from './VideoBottomBar.vue'
import { ATTENDEE, AVATAR } from '../../../constants.ts'
import { ATTENDEE, AVATAR, PARTICIPANT } from '../../../constants.ts'
import { EventBus } from '../../../services/EventBus.ts'
import { useCallViewStore } from '../../../stores/callView.ts'
import { useGuestNameStore } from '../../../stores/guestName.js'
Expand Down Expand Up @@ -456,7 +456,10 @@ export default {
},

hasVideo() {
return !this.model.attributes.videoBlocked && this.model.attributes.videoAvailable && this.sharedData.remoteVideoBlocker.isVideoEnabled() && (typeof this.model.attributes.stream === 'object')
return !!(this.participant.permissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO)
&& !this.model.attributes.videoBlocked
&& this.model.attributes.videoAvailable
&& this.sharedData.remoteVideoBlocker.isVideoEnabled() && (typeof this.model.attributes.stream === 'object')
},

hasSelectedVideo() {
Expand Down
18 changes: 12 additions & 6 deletions src/utils/webrtc/webrtc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1060,16 +1060,22 @@ export default function initWebRtc(signaling, _callParticipantCollection, _local
const removeSender = (hasAudioSenders && !(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO))
|| (hasVideoSenders && !(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO))

if (currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO) {
webrtc.webrtc.allowAudio()
} else {
const hasPublishAudioPermissions = !!(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_AUDIO)
const hasPublishVideoPermissions = !!(currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO)

if (!hasPublishAudioPermissions) {
// If permissions were revoked, disable media devices
webrtc.webrtc.disallowAudio()
} else if (!webrtc.webrtc.isAudioAllowed()) {
// If permissions were just granted and media was not previous allowed
// Mute audio to avoid unintentional audio publishing
webrtc.webrtc.mute()
}

if (currentParticipant.participantPermissions & PARTICIPANT.PERMISSIONS.PUBLISH_VIDEO) {
webrtc.webrtc.allowVideo()
} else {
if (!hasPublishVideoPermissions) {
webrtc.webrtc.disallowVideo()
} else if (!webrtc.webrtc.isVideoAllowed()) {
webrtc.webrtc.pauseVideo()
}

if (webrtc.webrtc.isLocalMediaActive()
Expand Down
Loading