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
New Contributor
lau_coop
Posts: 8
Registered: ‎06-28-2013
My Device: Blackberry Z10 developer
My Carrier: none

Force orientation when mediaplayer is playing

Hi everyone,

 

I would like to block my application in portrait mode but I use the mediaplayer invokation and I would like to change the orientation to landscape only when the mediaplayer is playing and return to portrait when the user closes the mediaplayer.

Is there a way to do that ?

 

I have tried to use :

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

 but it blocks the app in landscape even after the mediaplayer is closed.

Is there an event I can use to put back the orientation to portrait at the right time ?

Or is there another way to handle this ?

 

Thanks

Please use plain text.