Quantcast
Channel: User Liju - Stack Overflow
Viewing all articles
Browse latest Browse all 35

Answer by Liju for Making video fullscreen automatically when the device orientation is landscape with javascript

$
0
0

Add below code in your JavaScript:

window.addEventListener("orientationchange", function(event) {  var orientation = (window.screen.orientation || {}).type || window.screen.mozOrientation || window.screen.msOrientation;  if (["landscape-primary","landscape-secondary"].indexOf(orientation) !== -1) {    becomeFullscreen();  } else if (orientation === undefined) {    console.log("The orientation API isn't supported in this browser :(");   }});

Viewing all articles
Browse latest Browse all 35

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>