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

Mirror video in fullscreen.

This commit is contained in:
Antonin Décimo 2021-01-09 03:01:11 +01:00
parent 50a3d8b855
commit 28394bbc05

View file

@ -1074,7 +1074,11 @@ async function setMedia(c, isUp, mirror, video) {
/** @ts-ignore */
media.playsinline = true;
media.id = 'media-' + c.id;
div.appendChild(media);
let mirrorDiv = document.createElement('div');
div.appendChild(mirrorDiv);
mirrorDiv.appendChild(media);
if(!video)
addCustomControls(media, div, c);
if(mirror)
@ -1234,11 +1238,11 @@ function registerControlHandlers(media, container) {
fs.onclick = function(e) {
e.preventDefault();
if(media.requestFullscreen) {
media.requestFullscreen();
media.parentNode.requestFullscreen();
/** @ts-ignore */
} else if(media.webkitRequestFullscreen) {
} else if(media.parentNode.webkitRequestFullscreen) {
/** @ts-ignore */
media.webkitRequestFullscreen();
media.parentNode.webkitRequestFullscreen();
} else {
displayWarning('Full screen not supported!');
}