Skip to content

Commit

Permalink
feat(Screen): allow to zoom and pan screenshare content in Speaker View
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <[email protected]>
  • Loading branch information
Antreesy committed Jan 10, 2025
1 parent 2135540 commit de77116
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/components/CallView/shared/Screen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
<script>
import Hex from 'crypto-js/enc-hex.js'
import SHA1 from 'crypto-js/sha1.js'
import panzoom from 'panzoom'
import { ref, onMounted, onBeforeUnmount } from 'vue'

import { t } from '@nextcloud/l10n'

Expand Down Expand Up @@ -62,9 +64,31 @@ export default {
},
},

setup() {
setup(props) {
const guestNameStore = useGuestNameStore()
return { guestNameStore }

const screen = ref(null)
const screenPanzoomInstance = ref(null)

onMounted(() => {
if (props.isBig) {
screenPanzoomInstance.value = panzoom(screen.value, {
minZoom: 1,
maxZoom: 8,
bounds: true,
boundsPadding: 1,
})
}
})
onBeforeUnmount(() => {
screenPanzoomInstance.value?.dispose()
})

return {
guestNameStore,
screen,
screenPanzoomInstance,
}
},

computed: {
Expand Down
6 changes: 6 additions & 0 deletions src/components/SettingsDialog/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@
{{ t('spreed', 'Raise or lower hand') }}
</dd>
</div>
<div>
<dt><kbd>{{ t('spreed', 'Mouse wheel') }}</kbd></dt>
<dd class="shortcut-description">
{{ t('spreed', 'Zoom-in / zoom-out a screen share') }}
</dd>
</div>
</dl>
</NcAppSettingsSection>
</NcAppSettingsDialog>
Expand Down

0 comments on commit de77116

Please sign in to comment.