Skip to content

Commit

Permalink
Merge pull request #13026 from nextcloud/fix/noid/call-dev-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy committed Aug 19, 2024
2 parents 83ec165 + 312297a commit b2acc99
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 121 deletions.
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;