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

Remove PIP button when not supported.

This commit is contained in:
Juliusz Chroboczek 2020-11-09 00:35:52 +01:00
parent 01192d69fc
commit 85df898101

View file

@ -1090,11 +1090,17 @@ function registerControlEvent(peerid) {
} }
}; };
peer.querySelector("span.pip").onclick = function(event) { let pip = /** @type {HTMLElement} */(peer.querySelector("span.pip"));
event.preventDefault(); /** @ts-ignore */
let video = getParentVideo(event.target); if(HTMLVideoElement.prototype.requestPictureInPicture) {
videoPIP(video); pip.onclick = function(event) {
}; event.preventDefault();
let video = getParentVideo(event.target);
videoPIP(video);
};
} else {
pip.style.display = 'none';
}
peer.querySelector("span.fullscreen").onclick = function(event) { peer.querySelector("span.fullscreen").onclick = function(event) {
event.preventDefault(); event.preventDefault();
@ -1106,7 +1112,7 @@ function registerControlEvent(peerid) {
} }
}; };
let camera = peer.querySelector("span.camera"); let camera = /** @type {HTMLElement} */(peer.querySelector("span.camera"));
if(camera) { if(camera) {
peer.querySelector("span.camera").onclick = function(event) { peer.querySelector("span.camera").onclick = function(event) {
event.preventDefault(); event.preventDefault();