Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set devMode in CallView component #13026

Merged
merged 4 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 47 additions & 4 deletions src/components/CallView/CallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
<EmptyCallView v-if="showEmptyCallView" :is-sidebar="isSidebar" />

<div id="videos">
<div v-if="!isGrid || !callParticipantModels.length" class="video__promoted" :class="{'full-page': showFullPage}">
<div v-if="devMode ? !isGrid : (!isGrid || !callParticipantModels.length)"
class="video__promoted"
:class="{'full-page': showFullPage}">
<!-- Selected video override mode -->
<VideoVue v-if="showSelectedVideo && selectedCallParticipantModel"
:key="selectedVideoPeerId"
Expand Down Expand Up @@ -78,11 +80,22 @@
:is-one-to-one="isOneToOne"
:is-sidebar="isSidebar"
@force-promote-video="forcePromotedModel = $event" />

<div v-else-if="devMode && !isGrid"
class="dev-mode-video--promoted">
<img :alt="placeholderName(6)" :src="placeholderImage(6)">
<VideoBottomBar :has-shadow="false"
:model="placeholderModel(6)"
:shared-data="placeholderSharedData(6)"
:token="token"
:participant-name="placeholderName(6)"
is-big />
</div>
</div>

<!-- Stripe or fullscreen grid depending on `isGrid` -->
<Grid v-if="!isSidebar"
:is-stripe="!isGrid || !callParticipantModels.length"
:is-stripe="devMode ? !isGrid : (!isGrid || !callParticipantModels.length)"
:is-recording="isRecording"
:token="token"
:has-pagination="true"
Expand All @@ -92,6 +105,7 @@
:local-call-participant-model="localCallParticipantModel"
:shared-datas="sharedDatas"
v-bind="$attrs"
:dev-mode.sync="devMode"
@select-video="handleSelectVideo"
@click-local-video="handleClickLocalVideo" />

Expand Down Expand Up @@ -120,6 +134,7 @@

<script>
import debounce from 'debounce'
import { ref } from 'vue'

import { showMessage } from '@nextcloud/dialogs'
import { subscribe, unsubscribe } from '@nextcloud/event-bus'
Expand All @@ -131,9 +146,11 @@ import LocalVideo from './shared/LocalVideo.vue'
import PresenterOverlay from './shared/PresenterOverlay.vue'
import ReactionToaster from './shared/ReactionToaster.vue'
import Screen from './shared/Screen.vue'
import VideoBottomBar from './shared/VideoBottomBar.vue'
import VideoVue from './shared/VideoVue.vue'
import ViewerOverlayCallView from './shared/ViewerOverlayCallView.vue'

import { placeholderImage, placeholderModel, placeholderName, placeholderSharedData } from './Grid/gridPlaceholders.ts'
import { SIMULCAST } from '../../constants.js'
import { fetchPeers } from '../../services/callsService.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
Expand All @@ -146,13 +163,14 @@ export default {

components: {
EmptyCallView,
ViewerOverlayCallView,
Grid,
LocalVideo,
PresenterOverlay,
ReactionToaster,
Screen,
VideoBottomBar,
VideoVue,
ViewerOverlayCallView,
},

props: {
Expand All @@ -173,10 +191,14 @@ export default {
},

setup() {
// For debug and screenshot purposes. Set to true to enable
const devMode = ref(false)

return {
localMediaModel,
localCallParticipantModel,
callParticipantCollection,
devMode,
}
},

Expand Down Expand Up @@ -329,7 +351,7 @@ export default {
},

showEmptyCallView() {
return !this.callParticipantModels.length && !this.screenSharingActive
return !this.callParticipantModels.length && !this.screenSharingActive && !this.devMode
},

supportedReactions() {
Expand Down Expand Up @@ -440,6 +462,11 @@ export default {

methods: {
t,
// Placeholder data for devMode and screenshotMode
placeholderImage,
placeholderName,
placeholderModel,
placeholderSharedData,
/**
* Updates data properties that depend on the CallParticipantModels.
*
Expand Down Expand Up @@ -752,6 +779,22 @@ export default {
// doesn't affect screen shares, as it's a different MediaStream
position: static;
}

.dev-mode-video--promoted {
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
}

.dev-mode-video--promoted img {
position: absolute;
height: 100%;
aspect-ratio: 4 / 3;
object-fit: cover;
border-radius: var(--border-radius-element, calc(var(--default-clickable-area) / 2));
}
}

.local-video {
Expand Down
Loading
Loading