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

Implement automatic enabling of camera.

This commit is contained in:
Juliusz Chroboczek 2020-11-24 17:08:33 +01:00
parent 4c9762931d
commit 2c17157ea2
3 changed files with 20 additions and 1 deletions

View file

@ -456,7 +456,7 @@ textarea.form-reply {
position: absolute;
top: 15%;
left: 25%;
width: 21em;
width: 30em;
padding: 2em;
}

View file

@ -127,6 +127,11 @@
<label for="password">Password:</label>
<input id="password" type="password" name="password"
autocomplete="current-password" class="form-control"/>
<label>Present:</label>
<input id="presentoff" type="radio" name="presentradio" value="" checked/>
<label for="presentoff">nothing</label>
<input id="presentboth" type="radio" name="presentradio" value="both"/>
<label for="presentoff">camera and mike</label>
<div class="clear"></div>
<input id="connectbutton" type="submit" class="btn btn-blue" value="Connect"/>
</form>

View file

@ -272,6 +272,7 @@ function setConnected(connected) {
userpass ? userpass.username : '';
getInputElement('password').value =
userpass ? userpass.password : '';
getInputElement('presentoff').checked = true;
statspan.textContent = 'Disconnected';
statspan.classList.remove('connected');
statspan.classList.add('disconnected');
@ -1937,6 +1938,19 @@ document.getElementById('userform').onsubmit = async function(e) {
} finally {
connecting = false;
}
let presentboth = getInputElement('presentboth').checked;
if(presentboth) {
let button = getButtonElement('presentbutton');
button.disabled = true;
try {
let id = findUpMedia('local');
if(!id)
await addLocalMedia();
} finally {
button.disabled = false;
}
}
};
document.getElementById('disconnectbutton').onclick = function(e) {