From cbdb31b566d4b4bce252ac7b4119a629323a220c Mon Sep 17 00:00:00 2001 From: Joe McGrath <33670767+josephmcg@users.noreply.github.com> Date: Wed, 24 Aug 2022 23:04:27 +0900 Subject: [PATCH] feat(calls): add fullscreen support (#4439) --- components/ui/Global/Global.vue | 1 - components/views/media/Media.html | 16 +++++++++++--- components/views/media/Media.vue | 11 ++++++++++ components/views/media/heading/Heading.html | 8 +++---- components/views/media/heading/Heading.vue | 21 ++++++------------- .../views/navigation/sidebar/live/Live.html | 2 +- .../views/navigation/sidebar/live/Live.vue | 4 ---- store/ui/__snapshots__/state.test.ts.snap | 1 - store/ui/mutations.test.ts | 6 ------ store/ui/mutations.ts | 3 --- store/ui/state.ts | 1 - store/ui/types.ts | 1 - store/webrtc/actions.ts | 1 - 13 files changed, 35 insertions(+), 41 deletions(-) diff --git a/components/ui/Global/Global.vue b/components/ui/Global/Global.vue index a246d0b7ac..023552376e 100644 --- a/components/ui/Global/Global.vue +++ b/components/ui/Global/Global.vue @@ -108,7 +108,6 @@ export default Vue.extend({ * @example */ denyCall() { - this.$store.commit('ui/fullscreen', false) iridium.webRTC.denyCall() }, }, diff --git a/components/views/media/Media.html b/components/views/media/Media.html index 3e8e5468b8..c40497cb50 100644 --- a/components/views/media/Media.html +++ b/components/views/media/Media.html @@ -1,5 +1,10 @@ -
- +
+
- +
diff --git a/components/views/media/Media.vue b/components/views/media/Media.vue index 29e84c01d5..668a24b282 100644 --- a/components/views/media/Media.vue +++ b/components/views/media/Media.vue @@ -33,6 +33,7 @@ export default Vue.extend({ data() { return { webrtc: iridium.webRTC.state, + isFullscreen: false, } }, computed: { @@ -60,6 +61,16 @@ export default Vue.extend({ this.$Sounds.changeLevels(volume / 100) this.$store.commit('audio/setVolume', volume) }, + toggleFullscreen() { + if (!document.fullscreenElement) { + const media = this.$refs.mediastream as HTMLElement + media.requestFullscreen() + this.isFullscreen = true + } else if (document.exitFullscreen) { + document.exitFullscreen() + this.isFullscreen = false + } + }, }, }) diff --git a/components/views/media/heading/Heading.html b/components/views/media/heading/Heading.html index cba733e264..0e71f13018 100644 --- a/components/views/media/heading/Heading.html +++ b/components/views/media/heading/Heading.html @@ -1,12 +1,12 @@