10-15-2010 03:02 PM
On a variety of Handsets (9700, 9800, 9520, 9550,etc.) I am having a problem with my dataSource/sourceStream. I am streaming discrete aac/mp4 files to the media player. My streaming content is not the problem.
With my stream I do the following:
Create an HttpConnection with the URL of the content.
Get the length with httpConnection.getLength();
Open an InputStream on the httpConnection
Then in my implementation of read() I read that inputstream.
About 50% of the time, the input stream read completes (returns -1) with having only downloaded ~70% of the file. As a result the media player overruns the buffer and treats it as an EOF because it does not think there is anymore content.
There are no errors being reported at all.
The content being streamed is not the problem. I never see this on very old BBs like the 8110 and on my Android use of the same content stream. Also, it is inconsistent, as in two devices that have this problem don't fail on the same piece of content.
The simplest solution I can think of is to reconnect to the content when the media player reaches the EOF and the full content has not been downloaded. How can I do this? I want to be able to pick up playback where the download had stopped.
Are there other solutions that people have used for this problem?
10-19-2010 02:33 PM
Are you able to play the same streams using the Media Player? What route are you making your connection over? This article explains the various routes:
Different ways to make an HTTP or socket connection
If you haven't seen it, this article may help.
Streaming media - Start to finish
http://supportforums.blackberry.com/t5/Java-Develo
10-21-2010 07:40 PM
We are making our connection over direct tcp.
I don't know if I understand the question: "Are you able to play the same streams using the Media Player?"
Yes, the J2ME player gotten from Manager.createPlayer() plays the media correctly. The stream download is ending prematurely though. As a result, this is most likely an issue with the download of the stream and not the MediaPlayer using it.
Thank you for the links. I was aware of those articles. Pretty much any issue posted here results in those links being posted.
Thanks
Andrew
10-22-2010 10:46 AM
I meant the Media Player application on the BlackBerry Smartphone. Try to open the same stream in the BlackBerry Browser. Are you able to play it? This can help determine whether or not the issue is specific to your application.
10-25-2010 11:03 AM
Hi I bought new torch 2 weeks back and I am trying to play youtube and it fails, showing there is an error with the media player, please assist me
thank you
Bluhar 123