From 8292d7d82c5d3eb0d079ec90be5b27ee80cae981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 23 Dec 2021 12:30:36 +0100 Subject: [PATCH] Set a device id for VoIP example and use const/let MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- examples/voip/browserTest.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/voip/browserTest.js b/examples/voip/browserTest.js index fbf47c30b66..4a78db3ef2b 100644 --- a/examples/voip/browserTest.js +++ b/examples/voip/browserTest.js @@ -1,16 +1,17 @@ console.log("Loading browser sdk"); -var BASE_URL = "https://matrix.org"; -var TOKEN = "accesstokengoeshere"; -var USER_ID = "@username:localhost"; -var ROOM_ID = "!room:id"; +const BASE_URL = "https://matrix.org"; +const TOKEN = "accesstokengoeshere"; +const USER_ID = "@username:localhost"; +const ROOM_ID = "!room:id"; +const DEVICE_ID = "some_device_id"; - -var client = matrixcs.createClient({ +const client = matrixcs.createClient({ baseUrl: BASE_URL, accessToken: TOKEN, - userId: USER_ID + userId: USER_ID, + deviceId: DEVICE_ID }); -var call; +let call; function disableButtons(place, answer, hangup) { document.getElementById("hangup").disabled = hangup; @@ -19,7 +20,7 @@ function disableButtons(place, answer, hangup) { } function addListeners(call) { - var lastError = ""; + let lastError = ""; call.on("hangup", function() { disableButtons(false, true, true); document.getElementById("result").innerHTML = (