1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-09 18:25: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) {
event.preventDefault();
let video = getParentVideo(event.target);
videoPIP(video);
};
let pip = /** @type {HTMLElement} */(peer.querySelector("span.pip"));
/** @ts-ignore */
if(HTMLVideoElement.prototype.requestPictureInPicture) {
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) {
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) {
peer.querySelector("span.camera").onclick = function(event) {
event.preventDefault();