Welcome!

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

Native Development

Reply
Developer
Kaz32
Posts: 237
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha

Change orientation to landscape on Media Player Cards

Hi I use invoke manager to use media player to open video file. I want to change screen orientation to landscape when media player card opened (full screen) and lock it to landscape, when back from card then orientation change to portrait again and lock to portrait. So the landscape orientation only when video play on media player cards How to do this? Thanks
Contributor
samdanishaik
Posts: 30
Registered: ‎02-05-2013
My Device: 9860

Re: Change orientation to landscape on Media Player Cards

Hi,

 

I would like to know if someone have tried this? If so how we can achieve this?

 

Thanks.

Retired
Retired
BVP
Posts: 150
Registered: ‎10-19-2010
My Device: Not Specified

Re: Change orientation to landscape on Media Player Cards

Hi Kaz!

 

There currently isn’t a way to specify an orientation of the native media players through invoke, but they should match the orientation of the app that launched it.  In other words, it may be possible to rotate your app, invoke, rotate back in that order to achieve what you want.  I will preface that with the note that I haven't tried it myself, but hopefully it works :smileyhappy:

 

BVP

Developer
Curahee
Posts: 229
Registered: ‎01-12-2013
My Device: z30

Re: Change orientation to landscape on Media Player Cards

If the user want to view the movie in landscape, can't he just rotate the device then? I think it's up to the user to decide what he wants...

 

If you really want to do this, you can have a look if it's possible to change the orientation of your app before invoking the mediaplayer like BVP said.

 

OrientationSupport *support = OrientationSupport::instance();
support->setSupportedDisplayOrientation(SupportedDisplayOrientation::DisplayLandscape);

 

 I don't know if it's possible to catch an onCompleted event or something like that of the mediaplayer. Or maybe after the mediaplayer is invoked you can do something like

 

OrientationSupport *support = OrientationSupport::instance();
support->setSupportedDisplayOrientation(SupportedDisplayOrientation::DisplayPortrait);

 

 

More about that topic over here:

http://developer.blackberry.com/cascades/reference/bb__cascades__orientationsupport.html

______________________________________________________
BB10-OAuth: GitHub