Commit 0067edc6 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix some more Javascript typos.

Thanks to Rémi Nollet and Léo Stefanesco.
parent fc3ee842
...@@ -270,10 +270,10 @@ function newUpStream(id) { ...@@ -270,10 +270,10 @@ function newUpStream(id) {
c.onerror = function(e) { c.onerror = function(e) {
console.error(e); console.error(e);
displayError(e); displayError(e);
delUpMedia(c.id); delUpMedia(c);
} }
c.onabort = function() { c.onabort = function() {
delUpMedia(c.id); delUpMedia(c);
} }
return c; return c;
} }
...@@ -285,14 +285,16 @@ async function addLocalMedia(id) { ...@@ -285,14 +285,16 @@ async function addLocalMedia(id) {
let audio = mapMediaOption(document.getElementById('audioselect').value); let audio = mapMediaOption(document.getElementById('audioselect').value);
let video = mapMediaOption(document.getElementById('videoselect').value); let video = mapMediaOption(document.getElementById('videoselect').value);
let old = id && serverConnection.up[id];
if(!audio && !video) { if(!audio && !video) {
if(id) if(old)
delUpMedia(id); delUpMedia(old);
return; return;
} }
if(id) if(old)
stopUpMedia(id); stopUpMedia(old);
let constraints = {audio: audio, video: video}; let constraints = {audio: audio, video: video};
let stream = null; let stream = null;
...@@ -300,8 +302,8 @@ async function addLocalMedia(id) { ...@@ -300,8 +302,8 @@ async function addLocalMedia(id) {
stream = await navigator.mediaDevices.getUserMedia(constraints); stream = await navigator.mediaDevices.getUserMedia(constraints);
} catch(e) { } catch(e) {
console.error(e); console.error(e);
if(id) if(old)
delUpMedia(id); delUpMedia(old);
return; return;
} }
...@@ -364,7 +366,7 @@ function stopUpMedia(c) { ...@@ -364,7 +366,7 @@ function stopUpMedia(c) {
function delUpMedia(c) { function delUpMedia(c) {
stopUpMedia(c); stopUpMedia(c);
delMedia(c); delMedia(c.id);
c.close(true); c.close(true);
delete(serverConnection.up[c.id]); delete(serverConnection.up[c.id]);
setButtonsVisibility() setButtonsVisibility()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment