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%5FTo%5F-%5FPlay%5Fvideo%5Fwithin%5Fa%5FBlackBerry%5Fsmartphone%5Fapplication.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?