03-18-2009 08:19 PM - edited 03-18-2009 08:24 PM
According to this article: http://www.blackberry.com/knowledgecenterpublic/li
I can only invoke the media player on OS versions 4.3.0+.
It suggests launching the browser pointing to the avi file for prior OS versions.
If I have a video in the form of an array of bytes, is there any way I can launch the browser and play the bytes? Or is the only way to temporarily store the bytes as a file and then invoke the browser to that local file? If the user doesn't have an SD card am I out of luck?
Any help would be appreciated.
Solved! Go to Solution.
03-25-2009 12:35 PM - edited 03-25-2009 12:36 PM
Prior to version 4.3.0 you would need to save the movie to the BlackBerry (either built in memory or micro SD card) using a FileConnection. Once saved you can open the browser with a file:// URL.
Note that the FileConnection was added in version 4.2.0 of the BlackBerry API set. Previous releases require the movie to be available on a web server.
03-25-2009 12:46 PM - edited 03-26-2009 11:12 AM
I suppose I can check how much device memory is left, save the file and then launch the browser. I have some additional questions:
1) The video starts playing at a resolution that is much lower than the actual video file. If I go to the media application and open it, it fills up the entire video area up to the top of the screen and down to the play/stop buttons. Is there a way to make it play at its true resolution? I think this is a bug.
2) I know that the user can select "Full Screen", but my clips are very short, and it takes a few seconds to get to full screen. Is there any way to make the media player go immediately to full screen?
3) If the user presses the "Back" button while the media player is open, and they previously had the browser open with pages in its history, the previous web page will be loaded. Is there a way to make the back button return to my application whether or not they had the browser open?
03-31-2009 09:09 AM
For # 1 and 2 you can use the VideoControl.setDisplaySize method to control the size of video playback. This can be done before the player is started.
3. No, there is now way for your application to be alerted when the Media application has been closed or to prevent the browser from being displayed.
04-28-2009 02:23 PM
I can't call VideoControl.setDisplaySize when I launch the browser though right? I'm targeting 4.2.1+.
Some additional information is that this only happens on AT&T handsets that have been upgraded to 184.108.40.206.
It works on T-Mobile Curve, Storm, Bold, and 8800s that haven't been upgraded to 4.5.
04-28-2009 02:40 PM
Here's what I mean. When I launch the file through the browser it plays like this:
However, when I play it directly through the media player it plays like this: