From 8e395e38aca4c6469d276d3117b9eccd58584547 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sat, 23 Jan 2021 01:15:53 +0100 Subject: [PATCH] Add option to disable mirror view. --- static/galene.html | 7 ++++++- static/galene.js | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/static/galene.html b/static/galene.html index 0207530..3273160 100644 --- a/static/galene.html +++ b/static/galene.html @@ -180,7 +180,12 @@ - + +
+ + +
+
diff --git a/static/galene.js b/static/galene.js index 70e9fc0..3f21145 100644 --- a/static/galene.js +++ b/static/galene.js @@ -82,6 +82,7 @@ function getUserPass() { * @property {string} [request] * @property {boolean} [activityDetection] * @property {Array.} [resolution] + * @property {boolean} [mirrorView] * @property {boolean} [blackboardMode] * @property {string} [filter] */ @@ -234,6 +235,13 @@ function reflectSettings() { store = true; } + if(settings.hasOwnProperty('mirrorView')) { + getInputElement('mirrorbox').checked = settings.mirrorView; + } else { + settings.mirrorView = getInputElement('mirrorbox').checked; + store = true; + } + if(settings.hasOwnProperty('activityDetection')) { getInputElement('activitybox').checked = settings.activityDetection; } else { @@ -470,6 +478,14 @@ getSelectElement('audioselect').onchange = function(e) { changePresentation(); }; +getInputElement('mirrorbox').onchange = function(e) { + e.preventDefault(); + if(!(this instanceof HTMLInputElement)) + throw new Error('Unexpected type for this'); + updateSettings({mirrorView: this.checked}); + changePresentation(); +}; + getInputElement('blackboardbox').onchange = function(e) { e.preventDefault(); if(!(this instanceof HTMLInputElement)) @@ -1095,7 +1111,7 @@ async function addLocalMedia(id) { c.onstats = gotUpStats; c.setStatsInterval(2000); - await setMedia(c, true, true); + await setMedia(c, true, settings.mirrorView); setButtonsVisibility(); }