Fix fullscreen to maintain aspect ratio

Request fullscreen on player container instead of document root to ensure media maintains aspect ratio with object-fit: contain
This commit is contained in:
russell@unturf.com 2026-01-21 10:35:53 -05:00
parent 54e9303912
commit 45ebe5c0ae

View file

@ -32,9 +32,13 @@
*/
window.toggleFullscreen = function() {
if (!document.fullscreenElement) {
document.documentElement.requestFullscreen().catch(err => {
console.error('Error attempting to enable fullscreen:', err);
});
// Request fullscreen on the player container, not the whole document
const container = document.getElementById('playerContainer');
if (container) {
container.requestFullscreen().catch(err => {
console.error('Error attempting to enable fullscreen:', err);
});
}
} else {
document.exitFullscreen();
}