Skip to content

Commit

Permalink
fix(PresenterOverlay): limit overlay to video_promoted wrapper borders
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Dec 23, 2024
1 parent 119b42d commit 5488656
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<div id="videos">
<div v-if="devMode ? !isGrid : (!isGrid || !callParticipantModels.length)"
ref="videoPromotedWrapper"
class="video__promoted"
:class="{'full-page': showFullPage}">
<!-- Selected video override mode -->
Expand Down Expand Up @@ -73,6 +74,7 @@
@force-promote-video="forcePromotedModel = $event" />
<!-- presenter overlay -->
<PresenterOverlay v-if="shouldShowPresenterOverlay"
:key="promotedWrapperDimensions"
:token="token"
:model="presenterModel"
:shared-data="presenterSharedData"
Expand Down Expand Up @@ -237,6 +239,8 @@ export default {
showPresenterOverlay: true,
debounceFetchPeers: () => {},
forcePromotedModel: null,
resizeObserver: null,
promotedWrapperDimensions: null,
}
},

Expand Down Expand Up @@ -495,6 +499,9 @@ export default {

subscribe('switch-screen-to-id', this._switchScreenToId)
subscribe('set-background-blurred', this.setBackgroundBlurred)

this.resizeObserver = new ResizeObserver(this.updatePromotedWrapperDimensions)
this.resizeObserver.observe(this.$refs.videoPromotedWrapper)
},

beforeDestroy() {
Expand All @@ -506,6 +513,10 @@ export default {

unsubscribe('switch-screen-to-id', this._switchScreenToId)
unsubscribe('set-background-blurred', this.setBackgroundBlurred)

if (this.resizeObserver) {
this.resizeObserver.disconnect()
}
},

methods: {
Expand Down Expand Up @@ -800,6 +811,9 @@ export default {
}
},

updatePromotedWrapperDimensions([entry]) {
this.promotedWrapperDimensions = `${entry.contentRect.width}:${entry.contentRect.height}`
},
},
}
</script>
Expand Down

0 comments on commit 5488656

Please sign in to comment.