Skip to content

Commit

Permalink
fixup! fixup! Add presenter overlay when sharing screen
Browse files Browse the repository at this point in the history
  • Loading branch information
DorraJaouad committed Oct 13, 2023
1 parent 56e0bb5 commit 7dd9732
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
41 changes: 29 additions & 12 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
hide-bottom-bar
@click-video="toggleShowPresenterOverlay" />
</TransitionWrapper>
<!-- presenter button when it is collapsed -->
<NcButton v-else-if="!showPresenterOverlay && callParticipantModel.attributes.videoAvailable"
<!-- presenter button when presenter overlay is collapsed -->
<NcButton v-else-if="isPresenterCollapsed(callParticipantModel)"
:key="'presenter-overlay-button' + callParticipantModel.attributes.peerId"
:aria-label="t('spreed', 'Show presenter')"
title="Show presenter"
Expand Down Expand Up @@ -295,10 +295,6 @@ export default {
return this.$store.getters.isViewerOverlay
},

isStripeOpen() {
return this.$store.getters.isStripeOpen
},

isGrid() {
return this.$store.getters.isGrid && !this.isSidebar
},
Expand Down Expand Up @@ -405,7 +401,19 @@ export default {
return callParticipantModel => {
return callParticipantModel.attributes.peerId === this.shownRemoteScreenPeerId
&& this.showPresenterOverlay
&& callParticipantModel.attributes.videoAvailable
&& this.callParticipantModelsWithVideo.includes(callParticipantModel)
}
},

presenterVideoBlockerEnabled() {
return this.sharedDatas[this.shownRemoteScreenPeerId]?.remoteVideoBlocker?.isVideoEnabled()
},

isPresenterCollapsed() {
return callParticipantModel => {
return (callParticipantModel.attributes.peerId === this.shownRemoteScreenPeerId
&& !this.showPresenterOverlay
&& callParticipantModel.attributes.videoAvailable)
}
},

Expand Down Expand Up @@ -483,6 +491,11 @@ export default {
this.$store.dispatch('setCallViewMode', { isGrid: false })
}
},

presenterVideoBlockerEnabled(value) {
this.showPresenterOverlay = value

},
},
created() {
// Ensure that data is properly initialized before mounting the
Expand Down Expand Up @@ -762,7 +775,11 @@ export default {
},

toggleShowPresenterOverlay() {
this.showPresenterOverlay = !this.showPresenterOverlay
if (!this.presenterVideoBlockerEnabled) {
this.sharedDatas[this.shownRemoteScreenPeerId].remoteVideoBlocker.setVideoEnabled(true)
} else {
this.showPresenterOverlay = !this.showPresenterOverlay
}
}
},
}
Expand All @@ -789,14 +806,14 @@ export default {
}

.presenter-overlay__video {
position : absolute;
position: absolute;
bottom: 48px;
right: 8px;
--max-width: 242px;
--max-size: 242px;
width: 10vw;
height: 10vw;
max-width: var(--max-width);
max-height: var(--max-width);
max-width: var(--max-size);
max-height: var(--max-size);
z-index: 10;
}

Expand Down
24 changes: 7 additions & 17 deletions src/components/CallView/shared/VideoVue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
ref="videoContainer"
class="video-container"
:class="[containerClass, {
speaking: isSpeaking,
hover: mouseover && !unSelectable,
speaking: isSpeaking && !isBig,
hover: mouseover && !unSelectable && !isBig,
presenter: isPresenterOverlay && mouseover
}]"
@mouseover="showShadow"
Expand Down Expand Up @@ -689,42 +689,32 @@ export default {
top: calc(50% + 80px);
}

.video-container.speaking::after {
content: '';
.video-container::after {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
box-shadow: inset 0 0 0 2px white;
border-radius: calc(var(--default-clickable-area) / 2);
}
.video-container.speaking::after {
content: '';
box-shadow: inset 0 0 0 2px white;
}

.video-container.hover::after {
content: '';
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
box-shadow: inset 0 0 0 3px white;
cursor: pointer;
border-radius: calc(var(--default-clickable-area) / 2);
}

.video-container.presenter::after {
content: '' ;
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
background-image: var(--icon-toggle-white);
background-repeat: no-repeat;
background-position: center;
background-size: 25% 25%;
border-radius: calc(var(--default-clickable-area) / 2);
cursor: pointer;
}

Expand Down

0 comments on commit 7dd9732

Please sign in to comment.