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
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

player UI controls when streaming

Hi

 

when streaming through MM API(javax.microedition.media.Manager.createPlayer(url)) player controls( play, pause, stop, etc  buttons) are not shown how to do this?

is it possible to invoke player and provide link to play?

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: player UI controls when streaming

Yeah it is normal that no ui controls are shown.

 

If you want UI controls to be available you can make an invocation to the blackberry media application with your URL and the standard blackberry media app will be started while your application would go to the background.

However using this way gives your application no control over the playing process.

 

If you want control over the playing process you will need to implement the UI yourself.

----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: player UI controls when streaming

how to invoke media application

we cant do it using Invoke.invokeApplication()

do you have any sample?

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: player UI controls when streaming

Take a look at this thread http://supportforums.blackberry.com/t5/Java-Development/Use-Audio-or-Video-player-through-Invoke-inv...

 

Is this applicable to your scenario?

----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: player UI controls when streaming

that is not my scenario

I want to open directly, not through browser

 

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: player UI controls when streaming

[ Edited ]

OK then you will want maybe to try this:

 

/*
here is the url to your file
*/
Invocation request = new Invocation("file:///SDCard/BlackBerry/temp/train.mp3");
Registry registry = Registry.getRegistry
/*
this will work only in simulator on a real device you have to enter the fully qualified class name of your main application class(where your main method is located)
*/
("net.rim.device.api.content.BlackBerryContentHandler");
registry.invoke(request);

 

 

Does this work for you?

 

----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: player UI controls when streaming

I want stream from a remote url like

rtsp://url

 

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: player UI controls when streaming

well try to pass the rtsp://url to the Invocation constructor and see what will happen - I think there is a possibility that the media app will be invoked and start streaming.

What happens when you try this?
----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy
Developer
Posts: 326
Registered: ‎02-02-2009
My Device: Not Specified

Re: player UI controls when streaming

I tried with

Invocation request = new Invocation("rtsp://stream.the.sk/live/musicbox/musicbox-hm.3gp");
Registry registry = Registry.getRegistry("net.rim.device.api.content.BlackBerryContentHandler");
registry.invoke(request);

  exception class not found net.rim.device.api.content.BlackBerryContentHandler

then I tried with

http://supportforums.blackberry.com/t5/Java-Development/Invoke-the-Media-application/ta-p/442964

Invocation request = new Invocation("rtsp://stream.the.sk/live/musicbox/musicbox-hm.3gp");


Registry registry = Registry.getRegistry(Application.getApplication().getClass().getName());
registry.invoke(request);

 exception Protocol not found: net.rim.device.cldc.io.rtsp.Protocol

Developer
Posts: 402
Registered: ‎11-26-2010
My Device: Torch

Re: player UI controls when streaming

Both are wrong.

It has to be the name of your application's main class(where your main method is located)
----------------------------------------------------------------------
Press the button to give kudos if I helped you Smiley Happy