rough in fullscreen mode in watch view

This commit is contained in:
Isaac Connor 2021-11-09 14:32:06 -05:00
parent c76e688f05
commit acff4fb9c0
3 changed files with 34 additions and 0 deletions

View File

@ -947,3 +947,29 @@ function initThumbAnimation() {
});
}
}
/* View in fullscreen */
function openFullscreen(elem) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.webkitRequestFullscreen) {
/* Safari */
elem.webkitRequestFullscreen();
} else if (elem.msRequestFullscreen) {
/* IE11 */
elem.msRequestFullscreen();
}
}
/* Close fullscreen */
function closeFullscreen() {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.webkitExitFullscreen) {
/* Safari */
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
/* IE11 */
document.msExitFullscreen();
}
}

View File

@ -970,5 +970,10 @@ function initPage() {
});
} // initPage
function watchFullscreen() {
const content = document.getElementById('content');
openFullscreen(content);
}
// Kick everything off
$j(document).ready(initPage);

View File

@ -142,6 +142,9 @@ if ( $streamMode == 'jpeg' ) {
<button type="button" id="zoomOutBtn" title="<?php echo translate('ZoomOut') ?>" class="avail" data-on-click="streamCmdZoomOut">
<i class="material-icons md-18">zoom_out</i>
</button>
<button type="button" id="fullscreenBtn" title="<?php echo translate('Fullscreen') ?>" class="avail" data-on-click="watchFullscreen">
<i class="material-icons md-18">fullscreen</i>
</button>
<?php
} // end if streamMode==jpeg
?>