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

Improve typing, reindent.

This commit is contained in:
Juliusz Chroboczek 2020-11-08 17:07:17 +01:00
parent 3c57cc772e
commit 3c607a6e72

View file

@ -758,9 +758,10 @@ async function addLocalMedia(id, disableVideo) {
let settings = getSettings(); let settings = getSettings();
let audio = settings.audio ? {deviceId: settings.audio} : false; let audio = settings.audio ? {deviceId: settings.audio} : false;
let video = false; let video =
if (!disableVideo) disableVideo ? false :
video = settings.video ? {deviceId: settings.video} : false; settings.video ? {deviceId: settings.video} :
false;
if(audio) { if(audio) {
if(settings.studioMode) { if(settings.studioMode) {
@ -1004,13 +1005,13 @@ function setMedia(c, isUp) {
let top_controls = document.getElementById('topcontrols-' + c.id); let top_controls = document.getElementById('topcontrols-' + c.id);
if(template && !top_controls) { if(template && !top_controls) {
top_controls = top_template.cloneNode(true); top_controls = /** @type{HTMLElement} */(top_template.cloneNode(true));
top_controls.id = 'topcontrols-' + c.id; top_controls.id = 'topcontrols-' + c.id;
div.appendChild(top_controls); div.appendChild(top_controls);
} }
let controls = document.getElementById('controls-' + c.id); let controls = document.getElementById('controls-' + c.id);
if(template && !controls) { if(template && !controls) {
controls = template.cloneNode(true); controls = /** @type{HTMLElement} */(template.cloneNode(true));
controls.id = 'controls-' + c.id; controls.id = 'controls-' + c.id;
div.appendChild(controls); div.appendChild(controls);
if(media.muted) { if(media.muted) {
@ -1043,7 +1044,9 @@ function setMedia(c, isUp) {
* @param {HTMLVideoElement} video * @param {HTMLVideoElement} video
*/ */
async function videoPIP(video) { async function videoPIP(video) {
/** @ts-ignore */
if (video.requestPictureInPicture) { if (video.requestPictureInPicture) {
/** @ts-ignore */
await video.requestPictureInPicture(); await video.requestPictureInPicture();
} else { } else {
displayWarning("Video PIP Mode not supported!"); displayWarning("Video PIP Mode not supported!");