1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-23 00:55: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 */ /** @ts-ignore */
media.playsinline = true; media.playsinline = true;
media.id = 'media-' + c.id; media.id = 'media-' + c.id;
div.appendChild(media);
let mirrorDiv = document.createElement('div');
div.appendChild(mirrorDiv);
mirrorDiv.appendChild(media);
if(!video) if(!video)
addCustomControls(media, div, c); addCustomControls(media, div, c);
if(mirror) if(mirror)
@ -1234,11 +1238,11 @@ function registerControlHandlers(media, container) {
fs.onclick = function(e) { fs.onclick = function(e) {
e.preventDefault(); e.preventDefault();
if(media.requestFullscreen) { if(media.requestFullscreen) {
media.requestFullscreen(); media.parentNode.requestFullscreen();
/** @ts-ignore */ /** @ts-ignore */
} else if(media.webkitRequestFullscreen) { } else if(media.parentNode.webkitRequestFullscreen) {
/** @ts-ignore */ /** @ts-ignore */
media.webkitRequestFullscreen(); media.parentNode.webkitRequestFullscreen();
} else { } else {
displayWarning('Full screen not supported!'); displayWarning('Full screen not supported!');
} }