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
Highlighted
Trusted Contributor
Posts: 242
Registered: ‎03-16-2010
My Device: 9530
Accepted Solution

Unable to coneect to RTSP server

 

Hello,

 

    I am creating an app in J2ME trying to access video from rtsp server. If I connect via SocketConnetion :

 

SocketConnection sc = (SocketConnection)Connector.open("socket://rtsp://qt2.netro.ca:554");

 

I get IllegalException : Malformed

 

  On direct access, if I give http://java.sun.com/products/java-media/mma/media/test-mpeg.mpg, it works fine, but if I try to give :

 

player = Manager.createPlayer(url);   // URL = rtsp://qt2.netro.ca/princess_54.3gp

 

I don't get anything, no exception, error, it is not doing anything. Testing on wireless toolkit.

 

I am using :

WTK 2.5.0

JDK 6

 

Can anyone point out where am I going wrong? Why do I get MalformedException on Connection.open().

 

Any help is appreciated. Please help me solve out.

 

Thanks

 

 

 


--------------------------------------------------------------------------------
For any helpful answers give kudo's (star) to the helper.
Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: Unable to coneect to RTSP server

If you have rtsp url then that url will directly play the video in mobile browser like

 

BrowserSession browser = Browser.getDesaultSession();

browser.displayPage("your rtsp url");

Trusted Contributor
Posts: 242
Registered: ‎03-16-2010
My Device: 9530

Re: Unable to coneect to RTSP server

 

Thanks Swati,

 

   But I want to stream the video and show it. Not just display in the browser.

 

  But anyways, this also helped me as I learned something new.

 

Thanks. If you could help in my issue that would be good. I need to know the syntax for SocketConnection ("socket://.....") and DatagramConnection ("datagram://....)

 

Thanks

 

 


--------------------------------------------------------------------------------
For any helpful answers give kudo's (star) to the helper.
Trusted Contributor
Posts: 242
Registered: ‎03-16-2010
My Device: 9530

Re: Unable to coneect to RTSP server

Oh I found the solution.

 

For SocketConnection its :

SocketConnection sc = (SocketConnection)Connector.open("socket://qt2.netro.ca:554");

 

For DatagramConnection its :

socket = (DatagramConnection)Connector.open("datagram://:8080");

 

Just if anybody is stuck like me, this code coild be helpful.

 

Regards,

 


--------------------------------------------------------------------------------
For any helpful answers give kudo's (star) to the helper.
Developer
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: Unable to coneect to RTSP server

hey trupti it gave me a new idea too

thanks!!!