1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +01:00

Fix some more Javascript typos.

Thanks to Rémi Nollet and Léo Stefanesco.
This commit is contained in:
Juliusz Chroboczek 2020-08-13 20:30:55 +02:00
parent fc3ee84243
commit 0067edc6eb

View file

@ -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) {
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) {
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) {
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()