HTML5 Screen Orientation API

preview_player
Показать описание
This tutorial covers how you can detect the orientation of mobile devices as well as how you can listen for changes in the orientation of the device. Specifically, this deals with the portrait and landscape orientation of the screen, not the rotation of the device around the x, y, and z axis.

Рекомендации по теме
Комментарии
Автор

thanks, cool. simple vedio = better understanding

Lost_Man
Автор

Dear Steve,

First of all, thank you for the quality of the content on your channel, that I've subscribed to👏😊 I have watched your video several times but I know too little about programming and I'm desperate to get our school website to function the way we want it to!

We have designed a website where each page has 3 versions.
1) one version for screen width larger than 1024 px (both portrait and landscape orientations)
2) one version for screen width smaller than 1024 px in portrait orientation (which includes mobiles and tables)
3) one version for screen width smaller than 1024 px in landscape mode (which includes mobiles and tablets)

I'm desperately trying to figure out the script I should be typing in order to redirect to the right version of the page based on the screen resolution and orientation, also when the user switches orientations. I would be immensely grateful if you could help us on this one.

Many thanks and have a nice day 😊🙏

BluePlaneteer
Автор

Hi I'm new to coding and I'm working on my first app and in my app I have a live video that I embedded with a iframe tag and I want it to automatically rotate to landscape when it starts playing how would I be able to do that?

xgengaming
Автор

Great video, thanks. I noticed the content of the meta tag, is that essential for getting screen orientation to change on mobiles? If not, what should be done to allow screen orientation?

rumblyb
Автор

Hullo sir,
Does it works with React js too?
Kindly answer 🙄

abhay
Автор

How did you get those landscape mode on chrome?

jivanmainali
Автор

Can i block my website to only show it in portrait?

hector
Автор

thanks for your great video, but i wish you put the source code for download. this way is easier to follow what you say.

RameenFallschirmjager
Автор

I wish you put the source code for download.

mauriceford