12-17-2012 12:05 PM
Hi,
I'm building an app for BlackBerry 10 and I used this code in config.xml:
<feature id="blackberry.app.orientation">
<param name="mode" value="portrait" />
</feature>
The problem: I have videos on this app, and when playing fullscreen they keep the portrait orientation. It would be great if I can allow landscape mode only when playing video fullscreen. Is that possible?
Thanks.
Solved! Go to Solution.
12-17-2012 12:59 PM
Currently the only way to do this would be to set the blackberry.app.orientation to AUTO.
When it detects orientation change, have it dynamically switch the corresponding CSS to make it show properly.
You can also check here:
https://github.com/blackberry/BB10-WebWorks-Sample
Hope this helps.
12-17-2012 04:37 PM
Additional orientation api's were added in the last release:
https://developer.blackberry.com/html5/apis/blackb
rientationchange
https://developer.blackberry.com/html5/apis/blackb
https://developer.blackberry.com/html5/apis/blackb
You can also see sample usage here in the test suite:
If it helps, maybe you could contribute an update to the samples app with added functionality?
12-18-2012 05:00 AM
Thanks, I think that could help me a lot
Do you know if it's possible to listen for events telling me when a video is going fullscreen or quitting fullscreen mode ?
12-18-2012 09:33 AM
https://developer.blackberry.com/html5/apis/blackb
It doesn't seem to be exceptionally well documented, but it is there.
12-18-2012 10:00 AM
Sorry, i just looked into this further. The windowState won't give you the correct information. "fullscreen" means the app is in the normal running state, not the full fideo screen mode like i thought. There may actually be a way to do it with HTML5 built-in functionality. Adobe has a test-suite that has some media tests that you you may want to check out:
https://github.com/adobe/webkit/blob/master/Layout
12-18-2012 10:54 AM
Ok thanks, I'll look into it. My other option will be to programmatically allow orientation change when entering the screen with videos and forcing back "portrait mode" when leaving it. Then, I'll have to adapt the layout only for this screen*.
*of course, the best solution would be to make the entire app usable with both orientation
12-18-2012 03:52 PM
The following code seems to do it:
12-18-2012 05:07 PM
It is great that it works. If I recall correctly we ran into a limitation when locking the orientation of the application, then trying to allow rotation later. One thing you might want to note is that once you "unlock" in the config.xml, you should ensure you have portrait/landscape splash screen support.