diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index bbd34e7f59f..7d4948c72ee 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -56,6 +56,19 @@ @switchScreenToId="_switchScreenToId" /> + +
+ +
@@ -88,7 +101,8 @@ :local-media-model="localMediaModel" :local-call-participant-model="localCallParticipantModel" :shared-datas="sharedDatas" - @select-video="handleSelectVideo" /> + @select-video="handleSelectVideo" + @click-local-video="handleClickLocalVideo" /> 0 }, + // The following conditions determine what to show in the "Big container" + // of the promoted view - showSelected() { - return !this.isGrid && this.hasSelectedVideo && !this.showLocalScreen && !this.showRemoteScreen + // Show local screen (has priority over anything else when screensharing) + showLocalScreen() { + return this.screens.filter(screen => screen === localCallParticipantModel.attributes.peerId).length === 1 }, - showPromoted() { - return !this.isGrid && !this.hasSelectedVideo && !this.screenSharingActive + // Shows the local video if selected + showLocalVideo() { + return this.hasLocalVideo && this.$store.getters.selectedVideoPeerId === 'local' }, - showLocalScreen() { - return this.screens.filter(screen => screen === localCallParticipantModel.attributes.peerId).length === 1 + // Show selected video (other than local) + showSelected() { + return !this.isGrid && this.hasSelectedVideo && !this.showLocalScreen && !this.showLocalVideo + }, + // Show the current automatically promoted video + showPromoted() { + return !this.isGrid && !this.hasSelectedVideo && !this.screenSharingActive && !this.showLocalVideo }, + // Show somebody else's screen showRemoteScreen() { - return this.shownRemoteScreenPeerId !== null + return this.shownRemoteScreenPeerId !== null && !this.showLocalVideo }, shownRemoteScreenPeerId() { @@ -251,14 +287,6 @@ export default { return null }, - - gridTargetAspectRatio() { - if (this.isStripe) { - return 1 - } else { - return 1.5 - } - }, }, watch: { localScreen: function(localScreen) { @@ -295,6 +323,13 @@ export default { this.$store.dispatch('isGrid', false) } }, + 'hasLocalVideo': function(newValue) { + if (this.$store.getters.selectedVideoPeerId === 'local') { + if (!newValue) { + this.$store.dispatch('selectedVideoPeerId', null) + } + } + }, }, created() { @@ -456,6 +491,12 @@ export default { handleSelectVideo(peerId) { this.$store.dispatch('isGrid', false) this.$store.dispatch('selectedVideoPeerId', peerId) + this.isLocalVideoSelected = false + }, + handleClickLocalVideo() { + // Deselect possible selected video + this.$store.dispatch('selectedVideoPeerId', 'local') + this.$store.dispatch('isGrid', false) }, }, } diff --git a/src/components/CallView/Grid/Grid.vue b/src/components/CallView/Grid/Grid.vue index 50d4bd4708d..f593f510d82 100644 --- a/src/components/CallView/Grid/Grid.vue +++ b/src/components/CallView/Grid/Grid.vue @@ -62,7 +62,8 @@ :local-media-model="localMediaModel" :video-container-aspect-ratio="videoContainerAspectRatio" :local-call-participant-model="localCallParticipantModel" - @switchScreenToId="1" /> + @switchScreenToId="1" + @click-video="handleClickLocalVideo" />