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

Java Development

Reply
New Developer
Posts: 9
Registered: ‎09-11-2009
My Device: BlackBerry 9630
My Carrier: Developer

How to exit native Audio and Video Player

[ Edited ]

Hi All,

 

From my appluication I want to close (Exit) the native Audio and Video Player, if it is running. Please provide the code snip if any one have the idea.

 

Thanks & Regards,

Anindya Sen

New Developer
Posts: 39
Registered: ‎06-18-2009
My Device: BlackBerry Bold
My Carrier: Airtel

Re: How to exit native Audio and Video Player

Hi All

   I also have fetched the same issue. But in case of me I have invoke the media application from my application using

 

 

Invocation invocation = new Invocation(filePathTemp);
invocation.setResponseRequired(false);                            
invocation.setAction(ContentHandler.ACTION_OPEN); 
// Get the content handler for the media
Registry _registry = Registry.getRegistry("Main");
// Invoke the content handler.
_registry.invoke(invocation);

 

 

It sends my application in background and starts media application in foreground. But after finishing the play, when user press Back button in the device my application comes in foreground and the media application goes in background. I want to close the media application at that time. How to do that?

 

Regards

Hitangshu

Highlighted
Developer
Posts: 135
Registered: ‎08-27-2008
My Device: Not Specified

Re: How to exit native Audio and Video Player

Hi,

 

I am also facing the same problem. How to close the already running media player ?

 

 

Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: How to exit native Audio and Video Player

I also have this problem. Subsequent calls to invoke the media player will not work and this is printed in the log:

 

Detected background switch for MyApp(190) who has NO tunnels open - defocus NOT called
Detected foreground switch for net_rim_bb_mediacontenthandler(192) who has NO tunnels open - focus NOT called

 

If the media player can't be closed is there another work around?

New Contributor
Posts: 3
Registered: ‎05-20-2010
My Device: storm 9500
My Carrier: vodafone

Re: How to exit native Audio and Video Player

[ Edited ]

I had the same problem.

 

I resolved it by setting the invocation object's setResponseRequired to "true" and waiting for the Registry object's response.

 

Invocation.setRegistryRequired(true);
Registry registry = Registry.getRegistry(MyClass.class.getName());
registry.invoke(invocation);
Invocation response = registry.getResponse(true);
if(response.getStatus() == Invocation.OK)
System.exit(0);
New Developer
Posts: 16
Registered: ‎12-18-2008
My Device: Not Specified

Re: How to exit native Audio and Video Player

If I open the media player manually, on back click the media player gets closed but if I use Invoke to start the media player, on back click it does not get closed. Is there any alternative method to stop the Media player.

 

Thanks & Regards,

Akash.

New Developer
Posts: 16
Registered: ‎12-18-2008
My Device: Not Specified

Re: How to exit native Audio and Video Player

Were you able to close the native media player using above method?

 

I still face the same issue. If I clicks on back button, the player goes in the background and does not close. I have to manually close the player by clicking on menu and selecting close option.

 

Any solution?

 

Thanks,

Akash.

Regular Contributor
Posts: 75
Registered: ‎07-22-2010
My Device: Not Specified
My Carrier: Trainee

Re: How to exit native Audio and Video Player

Registry _registry = Registry.getRegistry("Main");

 

"Main" is what ?

Is it a class name? / package name?

I can not open any video file. please tell me how to  open a video file in BB's native player?

I want to play a video link. suppose there is a video on youtube. I know the source link.. Can it be possible to play it in Blackberry's native player????

 

Please please help me...

Thanks in Advance..

 

Contributor
Posts: 14
Registered: ‎07-31-2012
My Device: 9790
My Carrier: airtel

Re: How to exit native Audio and Video Player

How you play the youtube video using invocation class

I have tried it using this link : http://www.youtube.com/watch?v=TiviN10YCTQ

but its only open that page. video is not playing..

please give me some solutions...