Skip to content

Commit

Permalink
fix(mixin): remove unused and default props, refactor methods
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy authored and backportbot-nextcloud[bot] committed Dec 29, 2023
1 parent 58d262e commit 5b398d1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 88 deletions.
1 change: 0 additions & 1 deletion src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
:is-stripe="!isGrid"
:is-recording="isRecording"
:token="token"
:fit-video="true"
:has-pagination="true"
:min-height="isGrid && !isSidebar ? 240 : 150"
:min-width="isGrid && !isSidebar ? 320 : 200"
Expand Down
10 changes: 1 addition & 9 deletions src/components/CallView/Grid/Grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@
:is-stripe="isStripe"
:is-promoted="sharedDatas[callParticipantModel.attributes.peerId].promoted"
:is-selected="isSelected(callParticipantModel)"
:fit-video="false"
:video-container-aspect-ratio="videoContainerAspectRatio"
:shared-data="sharedDatas[callParticipantModel.attributes.peerId]"
@click-video="handleClickVideo($event, callParticipantModel.attributes.peerId)" />
</template>
Expand Down Expand Up @@ -100,7 +98,6 @@
:fit-video="isStripe"
:token="token"
:local-media-model="localMediaModel"
:video-container-aspect-ratio="videoContainerAspectRatio"
:local-call-participant-model="localCallParticipantModel"
@click-video="handleClickLocalVideo" />
</div>
Expand All @@ -122,7 +119,6 @@
:show-controls="false"
:token="token"
:local-media-model="localMediaModel"
:video-container-aspect-ratio="videoContainerAspectRatio"
:local-call-participant-model="localCallParticipantModel"
@click-video="handleClickLocalVideo" />
<!-- page indicator (disabled) -->
Expand Down Expand Up @@ -489,10 +485,7 @@ export default {
sidebarStatus() {
return this.$store.getters.getSidebarStatus
},
// Current aspect ratio of each video component
videoContainerAspectRatio() {
return (this.gridWidth / this.columns) / (this.gridHeight / this.rows)
},

wrapperStyle() {
if (this.isStripe) {
return 'height: 250px'
Expand Down Expand Up @@ -586,7 +579,6 @@ export default {
columnsMax: this.columnsMax,
rowsMax: this.rowsMax,
numberOfPages: this.numberOfPages,
videoContainerAspectRatio: this.videoContainerAspectRatio,
bodyWidth: document.body.clientWidth,
bodyHeight: document.body.clientHeight,
gridWidth: this.$refs.grid.clientWidth,
Expand Down
47 changes: 7 additions & 40 deletions src/components/CallView/shared/LocalVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
<div ref="videoContainer"
class="localVideoContainer videoContainer videoView"
:class="videoContainerClass"
@mouseover="showShadow"
@mouseleave="hideShadow"
@click="handleClickVideo">
@mouseover="mouseover = true"
@mouseleave="mouseover = false"
@click="$emit('click-video')">
<div v-show="localMediaModel.attributes.videoEnabled"
:class="videoWrapperClass"
class="videoWrapper"
:style="videoWrapperStyle">
<video id="localVideo"
ref="video"
disablePictureInPicture="true"
:class="videoClass"
:class="fitVideo ? 'video--fit' : 'video--fill'"
class="video"
@playing="updateVideoAspectRatio" />
</div>
Expand All @@ -51,7 +51,6 @@
:class="avatarClass" />
</div>

<div v-if="mouseover && isSelectable" class="hover-shadow" />
<div class="bottom-bar">
<NcButton v-if="isBig"
type="tertiary"
Expand Down Expand Up @@ -174,14 +173,7 @@ export default {
'video-container-stripe': this.isStripe,
'video-container-big': this.isBig,
'video-container-small': this.isSmall,
}
},

videoClass() {
if (this.fitVideo) {
return 'video--fit'
} else {
return 'video--fill'
'hover-shadow': this.isSelectable && this.mouseover,
}
},

Expand Down Expand Up @@ -257,7 +249,6 @@ export default {
},

watch: {

localCallParticipantModel: {
immediate: true,

Expand All @@ -278,7 +269,6 @@ export default {

localStreamVideoError: {
immediate: true,

handler(error) {
if (error) {
if (error.name === 'NotAllowedError') {
Expand Down Expand Up @@ -326,7 +316,6 @@ export default {
},

methods: {

_handleForcedMute() {
// The default toast selector is "body-user", but as this toast can
// be shown to guests too, a generic selector valid both for logged-in
Expand Down Expand Up @@ -368,29 +357,6 @@ export default {
// Fallback for Firefox
?? this.$refs.video.videoWidth / this.$refs.video.videoHeight
},

showShadow() {
if (this.isSelectable || this.mouseover) {
this.mouseover = true
}
},
hideShadow() {
if (this.isSelectable || this.mouseover) {
this.mouseover = false
}
},

handleClickVideo(e) {
// Prevent clicks on the media controls buttons to trigger a video selection
if (e.target.localName === 'button') {
return
}
// Prevent clicks on the "settings icon" of the popover/actions menu to trigger a video selection
if (e.target.localName === 'svg') {
return
}
this.$emit('click-video')
},
},

}
Expand Down Expand Up @@ -475,12 +441,13 @@ export default {
margin: auto;
}

.hover-shadow {
.hover-shadow:after {
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
content: '';
box-shadow: inset 0 0 0 3px white;
cursor: pointer;
border-radius: calc(var(--default-clickable-area) / 2);
Expand Down
44 changes: 6 additions & 38 deletions src/components/CallView/shared/VideoVue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
hover: mouseover && !unSelectable && !isBig,
presenter: isPresenterOverlay && mouseover
}]"
@mouseover="showShadow"
@mouseleave="hideShadow"
@click="handleClickVideo">
@mouseover="mouseover = true"
@mouseleave="mouseover = false"
@click="$emit('click-video')">
<TransitionWrapper name="fade">
<div v-show="showVideo"
:class="videoWrapperClass"
class="videoWrapper"
:style="videoWrapperStyle">
<video ref="video"
:disablePictureInPicture="!isBig"
:class="videoClass"
:class="fitVideo ? 'video--fit' : 'video--fill'"
class="video"
@playing="updateVideoAspectRatio" />
</div>
Expand Down Expand Up @@ -309,14 +309,6 @@ export default {
}
},

videoClass() {
if (this.fitVideo) {
return 'video--fit'
} else {
return 'video--fill'
}
},

videoWrapperClass() {
return {
'icon-loading': this.isLoading,
Expand Down Expand Up @@ -527,7 +519,6 @@ export default {
},

watch: {

'model.attributes.stream'(stream) {
this._setStream(stream)
},
Expand Down Expand Up @@ -563,7 +554,6 @@ export default {
},

methods: {

_setStream(stream) {

if (!stream) {
Expand Down Expand Up @@ -605,29 +595,6 @@ export default {
// Fallback for Firefox
?? this.$refs.video.videoWidth / this.$refs.video.videoHeight
},

showShadow() {
if (this.isSelectable || this.mouseover) {
this.mouseover = true
}
},
hideShadow() {
if (this.isSelectable || this.mouseover) {
this.mouseover = false
}
},

handleClickVideo(e) {
// Prevent clicks on the media controls buttons to trigger a video selection
if (e.target.localName === 'button') {
return
}
// Prevent clicks on the "settings icon" of the popover/actions menu to trigger a video selection
if (e.target.localName === 'svg') {
return
}
this.$emit('click-video')
},
},

}
Expand Down Expand Up @@ -737,6 +704,7 @@ export default {
left: 0;
border-radius: calc(var(--default-clickable-area) / 2);
}

.video-container.speaking::after {
content: '';
box-shadow: inset 0 0 0 2px white;
Expand All @@ -758,7 +726,7 @@ export default {
}

.video-container.presenter::after {
content: '' ;
content: '';
background-color: rgba(0, 0, 0, 0.5);
cursor: pointer;
}
Expand Down

0 comments on commit 5b398d1

Please sign in to comment.