From db819af8af41cb3ac438062234307ea2039f3be1 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Sun, 29 Oct 2023 14:15:15 -0700 Subject: [PATCH] Easy video zoom in/out buttons --- src/App.vue | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/App.vue b/src/App.vue index d2e3e50..9e74f2f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -574,6 +574,10 @@ export default { if (this.webcam.vipOnly && this.isVIP) status |= this.VideoFlag.VipOnly; return status; }, + anyVideosOpen() { + // Return if any videos are open. + return this.webcam.active || this.numVideosOpen > 0; + }, numVideosOpen() { // Return the count of other peoples videos we have open. return Object.keys(this.WebRTC.streams).length; @@ -2800,6 +2804,35 @@ export default { } }, + // Scale the video zoom setting up or down. + scaleVideoSize(bigger) { + // Find the current size index. + let currentSize = 0; + for (let option of this.webcam.videoScaleOptions) { + if (option[0] === this.webcam.videoScale) { + break; + } + currentSize++; + } + + // Adjust it. + if (bigger) { + currentSize++; + } else { + currentSize--; + } + + // Constrain it. + if (currentSize < 0) { + currentSize = 0; + } else if (currentSize >= this.webcam.videoScaleOptions.length) { + currentSize = this.webcam.videoScale.length - 1; + } + + // Set it. + this.webcam.videoScale = this.webcam.videoScaleOptions[currentSize][0]; + }, + /** * Sound effect concerns. */ @@ -3734,6 +3767,21 @@ export default { + +
+ + + +
+