Skip to content

Commit

Permalink
fix: use LocalVideo component in screenshot mode
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>

[skip ci]
  • Loading branch information
Antreesy authored and backportbot[bot] committed Oct 14, 2024
1 parent 6a72f65 commit a4ba108
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/components/CallView/Grid/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,16 @@
<h1 v-if="!screenshotMode" class="dev-mode__title">
Dev mode on ;-)
</h1>
<div v-else
class="dev-mode-video--self video"
:style="{'background': 'url(' + placeholderImage(8) + ')'}" />
</template>
<LocalVideo v-if="!isStripe && !isRecording && !screenshotMode"
<LocalVideo v-if="!isStripe && !isRecording"
ref="localVideo"
class="video"
is-grid
:fit-video="false"
:token="token"
:local-media-model="localMediaModel"
:local-call-participant-model="localCallParticipantModel"
:screenshot-mode-url="screenshotMode ? placeholderImage(8) : ''"
@click-video="handleClickLocalVideo" />
</div>
<NcButton v-if="hasNextPage && gridWidth > 0"
Expand All @@ -98,14 +96,15 @@
</template>
</NcButton>
</div>
<LocalVideo v-if="isStripe && !isRecording && !screenshotMode"
<LocalVideo v-if="isStripe && !isRecording"
ref="localVideo"
class="video"
:is-stripe="true"
:show-controls="false"
:token="token"
:local-media-model="localMediaModel"
:local-call-participant-model="localCallParticipantModel"
:screenshot-mode-url="screenshotMode ? placeholderImage(8) : ''"
@click-video="handleClickLocalVideo" />

<template v-if="devMode">
Expand Down Expand Up @@ -1021,11 +1020,6 @@ export default {
position: relative;
&--self {
background-size: cover !important;
border-radius: calc(var(--default-clickable-area) / 2);
}
img {
object-fit: cover;
height: 100%;
Expand Down
18 changes: 16 additions & 2 deletions src/components/CallView/shared/LocalVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
@mouseover="mouseover = true"
@mouseleave="mouseover = false"
@click="$emit('click-video')">
<div v-show="localMediaModel.attributes.videoEnabled"
<img v-if="screenshotModeUrl"
class="dev-mode-video--self videoWrapper"
alt="dev-mode-video--self"
:src="screenshotModeUrl">

<div v-show="!screenshotModeUrl && localMediaModel.attributes.videoEnabled"
class="videoWrapper"
:style="videoWrapperStyle">
<video id="localVideo"
Expand All @@ -23,7 +28,7 @@
:size="avatarSize / 2"
class="video-loading" />
</div>
<div v-if="!localMediaModel.attributes.videoEnabled && !isSidebar" class="avatar-container">
<div v-if="!screenshotModeUrl && !localMediaModel.attributes.videoEnabled && !isSidebar" class="avatar-container">
<VideoBackground v-if="isGrid || isStripe"
:display-name="displayName"
:user="userId" />
Expand Down Expand Up @@ -118,6 +123,10 @@ export default {
type: Boolean,
default: false,
},
screenshotModeUrl: {
type: String,
default: '',
}
},
emits: ['click-video'],
Expand Down Expand Up @@ -445,4 +454,9 @@ export default {
}
}
}
.dev-mode-video--self {
object-fit: cover !important;
border-radius: calc(var(--default-clickable-area) / 2);
}
</style>

0 comments on commit a4ba108

Please sign in to comment.