diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-01-24 12:52:57 +0100 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-01-30 13:52:34 +0100 |
commit | e6ff2b15666f163c9c2e0bc4fcf9d3efba285a09 (patch) | |
tree | 04278462595104725ac6c0f70125a4c9c8028c36 | |
parent | 28508826f045172892fc4480bdad73e4e6830e7d (diff) |
chore(CallView): reorganize promoted video code
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/components/CallView/CallView.vue | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index 679cc9ce7..c6c607a64 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -35,21 +35,18 @@ <div id="videos"> <template v-if="!isGrid"> <!-- Selected video override mode --> - <div v-if="showSelectedVideo" + <div v-if="showSelectedVideo && selectedCallParticipantModel" class="video__promoted selected-video" :class="{'full-page': isOneToOne}"> - <template v-for="callParticipantModel in reversedCallParticipantModels"> - <VideoVue v-if="callParticipantModel.attributes.peerId === selectedVideoPeerId" - :key="callParticipantModel.attributes.selectedVideoPeerId" - :token="token" - :model="callParticipantModel" - :shared-data="sharedDatas[selectedVideoPeerId]" - :show-talking-highlight="false" - :is-grid="true" - :is-big="true" - :is-one-to-one="isOneToOne" - :fit-video="true" /> - </template> + <VideoVue :key="selectedVideoPeerId" + :token="token" + :model="selectedCallParticipantModel" + :shared-data="sharedDatas[selectedVideoPeerId]" + :show-talking-highlight="false" + :is-one-to-one="isOneToOne" + is-grid + is-big + fit-video /> </div> <!-- Screens --> <div v-else-if="showLocalScreen || showRemoteScreen || showSelectedScreen" id="screens"> @@ -299,6 +296,15 @@ export default { return this.$store.getters.selectedVideoPeerId }, + selectedCallParticipantModel() { + if (!this.showSelectedVideo || !this.selectedVideoPeerId) { + return null + } + return this.callParticipantModels.find(callParticipantModel => { + return callParticipantModel.attributes.peerId === this.selectedVideoPeerId + }) + }, + hasSelectedScreen() { return this.selectedVideoPeerId !== null && this.screens.includes(this.selectedVideoPeerId) }, @@ -310,14 +316,11 @@ export default { isOneToOne() { return this.callParticipantModels.length === 1 }, + hasLocalVideo() { return this.localMediaModel.attributes.videoEnabled }, - hasRemoteVideo() { - return this.callParticipantModelsWithVideo.length > 0 - }, - hasLocalScreen() { return !!this.localMediaModel.attributes.localScreen }, |