Skip to content

Commit

Permalink
fix: two cases where we force presentation mode: either screen share …
Browse files Browse the repository at this point in the history
…or selected video. If both of happen at the same time (e.g: someone shared a screen and you are focusing of a video), closing one of them should not trigger restore to the previous state which will cancel the other.

Signed-off-by: DorraJaouad <[email protected]>
  • Loading branch information
DorraJaouad authored and Antreesy committed May 13, 2024
1 parent 59c39ff commit 698a5a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -376,16 +376,17 @@ export default {
// Everytime a new screen is shared, switch to promoted view
if (newValue.length > previousValue.length) {
this.$store.dispatch('startPresentation')
} else if (newValue.length === 0 && previousValue.length > 0 && !this.hasLocalScreen) {
// last screen share stopped, reopening stripe
} else if (newValue.length === 0 && previousValue.length > 0 && !this.hasLocalScreen && !this.selectedVideoPeerId) {
// last screen share stopped and no selected video, restoring previous state
this.$store.dispatch('stopPresentation')
}
},
showLocalScreen(showLocalScreen) {
// Everytime the local screen is shared, switch to promoted view
if (showLocalScreen) {
this.$store.dispatch('startPresentation')
} else if (this.callParticipantModelsWithScreen.length === 0) {
} else if (this.callParticipantModelsWithScreen.length === 0 && !this.selectedVideoPeerId) {
// last screen share stopped and no selected video, restoring previous state
this.$store.dispatch('stopPresentation')
}
},
Expand Down Expand Up @@ -634,9 +635,8 @@ export default {
if (this.isSidebar) {
return
}
this.$store.dispatch('startPresentation')
this.$store.dispatch('selectedVideoPeerId', peerId)
this.isLocalVideoSelected = false
this.$store.dispatch('startPresentation')
},
handleClickLocalVideo() {
// DO nothing if no video
Expand Down

0 comments on commit 698a5a5

Please sign in to comment.