Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

255
Views
Stop fullscreen HTML5 video rotating on trigger

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();
    }

}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!