If I trigger fullscreen in Chrome Android, portrait mode it automatically rotates the fullscreen video to landscape.
To get it back to portrait fullscreen I have to rotate the device landscape then back to portrait.
How can I launch fullscreen to match the orientation that the user is using?
i.e if the device is in portrait and I trigger fullscreen it opens in portrait fullscreen, and if the device is in landscape it triggers landscape fullscreen
I still want to be able to rotate my device to change orientation, I just want it to match the native orientation. It works fine in the emulator on Mac Chrome, just not on my Android mobile device.
videoSmallTrigger.on('click', function() {
if (!document.isFullScreen && !document.fullscreenElement && !document.webkitFullscreenElement && !document.mozFullScreenElement && !document.msFullscreenElement) {
openFullscreen(videoSmallID);
body.addClass('fullscreen-video-sm');
videoSmall.get(0).play();
}
});
function openFullscreen(element) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
}
}