Possible Duplicate:
Playing an InputStream video in Blackberry JDE
I've seen a lot of different methods for doing so, but none of them are specific (and my attempts to implement them have all failed).
Does there exist a known way to stream http video on a Blackberry? Sample code, tutorials, anything?
The closest I've found is: http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To_-_Play_video_within_a_BlackBerry_smartphone_application.html?nodeid=1383173&vernum=0
The above tutorial, but it has several problems:
First, the sample code it gives is for a local video (which I can successfully play). It claims that "any valid URL" will work for HTTP streaming, but this is patently false, as supplying a known good .sgp URL does nothing.
The createPlayer method has the ability to accept an InputStream, which sounded promising, so I modified the sample code to have the lines:
// player = Manager.createPlayer("file:///SDCard/eggs.3gp");
HttpConnection c = (HttpConnection)Connector.open("http://good-3gp-videos.com/viapic/e39903da6e5c1e1c5d572a49a88a99e6.3gp");
int rc = c.getResponseCode();
if (rc != HttpConnection.HTTP_OK) {
throw new IOException("HTTP response code: " + rc);
}
player = Manager.createPlayer(c.openInputStream(), null);
player.realize();
Instead of the previous player created from a string (commented out in my source).
This however, gets me the exact same problem (specifically, attempting to play the video gets me a "JUM Error 104: Uncaught NullPointer Exception". )
It seems that both ways I attempt to read from a URL are getting me a Null response.
This is my first Blackberry App, so I'm not very familiar with how to debug it (for example, several times there is a System.out.println() call in the sample code, but I never see it displayed on the console.
How would I go about debugging the code, or alternatively, what is the correct way to stream HTTP video?
Modifying the code slightly, (adding a cast to Stream Connection) gets rid of my null pointer error, but even though nothing crashes, and there are no exceptions, it's still not streaming.
I have indeed heard that the simulators cannot stream, but putting the code on a phone doesn't work for me either.
Even more confusing, neither my simulator or my actual phone can stream RTSP from m.youtube, which I've heard works. I get a server/content not found error.
Is it possible that my workplace's firewall is preventing something important from happening?