From 78decefe5e1f7b50ae9060ffbe9f96656976a4f5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20D=C3=B6ring?= <simon.doering@stud.hs-bochum.de>
Date: Tue, 2 Feb 2021 20:28:26 +0100
Subject: [PATCH] Change customNameAllowed query param for sender (altered
 patch from pgerwinski)

---
 README.md               | 2 +-
 sender/camera-sender.js | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 9124821..d956102 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ The following list explains the usage of the parameters:
 
 * `pin` *optional*: The pin for the janus room. If the janus room has no pin, provide the value `none`. If this parameter is not provided, an input field for the pin is shown.
 
-* `customNameAllowed` *optional*: If this parameter is present (even when holding no value), an input field for a custom name is shown. The user can also update his name after starting a transmission. The names are escaped on the server to prevent Cross-Site-Scripting (XSS) attacks.
+* `customNameAllowed` *optional*: If this parameter is present (even when holding no value), an input field for a custom name is shown. If a value is provided for this field, it will be used as initial value of the input field. The user can also update his name after starting a transmission. The names are escaped on the server to prevent Cross-Site-Scripting (XSS) attacks.
 
 # Camera Server
 
diff --git a/sender/camera-sender.js b/sender/camera-sender.js
index f74a911..0a8e960 100644
--- a/sender/camera-sender.js
+++ b/sender/camera-sender.js
@@ -380,6 +380,7 @@ document.addEventListener('DOMContentLoaded', function() {
         var param = urlParams.get('customNameAllowed');
         customNameAllowed = param != null;
         if (customNameAllowed) {
+            document.getElementById('name-input').value = param;
             showElement(document.getElementById('name-control'));
         }
     }
-- 
GitLab