i make a website with video embedded from google drive, and i have a problem when playing that video on my browser android, if i entered to fullscreen mode the orientation video still in portrait mode like this.
i want to automatically force it to landscape mode when in fullscreen mode like this.
this is my html code:
<div class="konteneriframe">
<iframe class="videoiframe" title="<?php if($d['jenisfilm']=='Movie'){ echo $d['judulfilm']; } elseif($d['jenisfilm']=='Series'){ echo $d['judulfilm']; ?> Season <?php echo $d['musim']; ?> Episode <?php echo $d['episode']; } ?>" src="<?php echo $d["alamatfilm"]; ?>" frameborder="0" scrolling="no" seamless="" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen"></iframe>
<div class="blockershare"></div>
</div>
and this is my css code:
.konteneriframe{
position: relative;
border:none;
width: 100%;
margin-left: auto;
margin-right: auto;
min-height: 490px;
max-height: 550px;
}
.blockershare{
width: 80px;
height: 80px;
position: absolute;
opacity: 0;
right: 0px;
top: 0px;
}
.videoiframe{
border:none;
width: 100%;
margin-left: auto;
margin-right: auto;
min-height: 490px;
max-height: 550px;
}
@media(max-width: 600px){
.videoiframe, .konteneriframe{
min-height: 250px;
}
}
@media(width: 1366px){
.videoiframe{
max-height: 450px;
}
}
@media(width: 1920px){
.videoiframe{
max-height: 700px;
}
}
any code i need to add like javascript or css code?
Please help. thank you very much.
You can listen for fullscreen change events using the fullscreenchange and webkitfullscreenchange events. When the fullscreen mode changes, we check if the video iframe is in fullscreen mode. If the video iframe is in fullscreen mode, we call the forceLandscapeMode() function.
add this code after your html code