Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 178
Registered: ‎03-10-2011
My Device: Not Specified

Embed YouTube Player and Lock Orientation 'animation'

My app supports both landscape and portrait mode, it needs to temporarily lock orientation to landscape mode when embed YouTube Player is triggered -- so YouTube Player is always launched in landscape mode.


I couldn't do this in PlayBook because no such API in PB's SDK (so I have to force app running in landscape mode in PB's config.xml)


BB10 SDK, does provide API to programmically rotate/lock orientation with one line code:



It works, with some annoying issues:

1. If this API is fired when app is in portrait mode, it rotates app to landscape mode and then locks screen. That's expected and works great.

2. If this API is fired when app is in landscape mode, it still tries to rotate -- from what the simulator behaves -- screen is scaled down a little bit and then restored back to full size. This isn't what I expected, it gives a bad user experence, I certainly don't want user to notice such 'animation' when one clicks to launch the player. 


Q1: This is simulator's issue or, it is designed in this way?


Somehow simulator hung after quickly and keeping locking and unlocking orientation


Q2: Does this look like simulator problem? 


Q3: Is there any better way to play YouTube clips? I also tried to use invoke for YouTube video URL, because I don't have target name for youtube player if there is, Web browser is always triggered with invoke.invoke API call.