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: 406
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Invoke media player

How can i invoke my native media player from a browserfield and what type of video it supports

Developer
Posts: 406
Registered: ‎06-22-2010
My Device: na
My Carrier: blackberry developer

Re: Invoke media player

I have also tried with Content Handler 

byte[] data = null;
												InputStream is = getClass().getResourceAsStream("/media/BlackBerry.mp4");
												
												try {
													 data = IOUtilities.streamToBytes(is, 1024);
												} catch (IOException e1) {
													// TODO Auto-generated catch block
													e1.printStackTrace();
												}
												String url = new String(data);
												Invocation invocation = new Invocation(url); 
												Registry reg = Registry.getRegistry("net.rim.device.api.content.BlackBerryContentHandler");
												try {
													reg.invoke(invocation);
												} catch (IllegalArgumentException e) {
													// TODO Auto-generated catch block
													e.printStackTrace();
												} catch (ContentHandlerException e) {
													// TODO Auto-generated catch block
													e.printStackTrace();
												} catch (SecurityException e) {
													// TODO Auto-generated catch block
													e.printStackTrace();
												} catch (IOException e) {
													// TODO Auto-generated catch block
													e.printStackTrace();
												}

 But it fails.But instead of picking it frm my resource,if i pick from SDCard than it plays,but want to play from my resource folder