Commit ad034036 authored by Alain Takoudjou's avatar Alain Takoudjou

Cleanup and make code compliant with ts

parent 4270cd0e
......@@ -1194,7 +1194,6 @@ function updateControlStatus(id, isLocal, shared, audioMode, muted) {
* @param {string} peerid
*/
function registerControlEvent(peerid) {
let settings = getSettings();
let peer = document.getElementById(peerid);
//Add event listener when a video component is added to the DOM
let volume = /** @type {HTMLElement} */(peer.querySelector("span.volume"));
......@@ -1245,24 +1244,30 @@ function registerControlEvent(peerid) {
};
}
let media = /** @type {HTMLElement} */(peer.querySelector("video.media"));
media.onenterpictureinpicture = function(event) {
if(event.target.classList.contains('media-static'))
return;
event.target.classList.remove('media-mirror');
};
let media = /** @type {HTMLVideoElement} */(peer.querySelector("video.media"));
/** @ts-ignore */
if(media.onenterpictureinpicture && media.onleavepictureinpicture) {
/** @ts-ignore */
media.onenterpictureinpicture = function(event) {
if(event.target.classList.contains('media-static'))
return;
event.target.classList.remove('media-mirror');
};
media.onleavepictureinpicture = function(event) {
if(event.target.classList.contains('media-static'))
return;
event.target.classList.add('media-mirror');
};
/** @ts-ignore */
media.onleavepictureinpicture = function(event) {
if(event.target.classList.contains('media-static'))
return;
event.target.classList.add('media-mirror');
};
}
let stop = /** @type {HTMLElement} */(peer.querySelector(".stopsharing"));
if (stop) {
stop.onclick = function(event) {
event.preventDefault();
let video = getParentVideo(event.target);
let element = /** @type {HTMLElement} */(event.target);
let video = getParentVideo(element);
let video_id = video.id.split("-")[1];
for(let id in serverConnection.up) {
if (video_id === id) {
......
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