[whatwg] Forcing orientation in content
bruant.d at gmail.com
Wed Apr 17 15:52:47 PDT 2013
Currently working on a web project where tablet support (iPad
especially) is important, I'm facing a need which apparently the
platform doesn't support.
I would need to lock the screen in landscape mode.
I've been searching and StackOverflow suggested this is not possible
. The best solution that I have read online was to listen to
orientation changes, update an "orient" attribute (on <body> or <html>)
and change the CSS based on that. Or Media Queries. But I don't really
should. Especially given that in some comments , it is suggested that
it is possible to lock the orientation in native apps.
Beyond my current project, I have participated to a "FirefoxOS app days"
in Bucharest (helped people developing their apps mostly answering their
questions). A participant wanted to port his website (games for ~5yo
kids) as an FirefoxOS app and told me clearly that if he had no way to
lock the screen in landscape, he wouldn't be interested in FirefoxOS
(pretty sharp opinion, but that's what he said). Fortunately, that's
possible, but one has to use metadata to do so .
So I feel the need is there.
I was wondering if it would be possible to add a <meta> (or whatever
else is felt more relevant) to lock the orientation declaratively. It
sounds like an information that belongs to the <head>. I feel the
FirefoxOS experience  sets a good example.
More information about the whatwg