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
Developer
Developer
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified
Accepted Solution

Options for video play back

[ Edited ]

According to this article: http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To...

 

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.

Message Edited by bo on 03-18-2009 08:24 PM
BlackBerry Development Advisor
Posts: 15,813
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Options for video play back

[ Edited ]

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.

Message Edited by MSohm on 03-25-2009 12:36 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Developer
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: Options for video play back

[ Edited ]

Thanks!

 

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?

 

Message Edited by bo on 03-26-2009 11:12 AM
Highlighted
BlackBerry Development Advisor
Posts: 15,813
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Options for video play back

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.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Developer
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: Options for video play back

Thanks Mark. 

 

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 4.5.0.110.

 

It works on T-Mobile Curve, Storm, Bold, and 8800s that haven't been upgraded to 4.5.

Developer
Developer
Posts: 167
Registered: ‎11-12-2008
My Device: Not Specified

Re: Options for video play back

Here's what I mean.  When I launch the file through the browser it plays like this:

 

http://img144.imageshack.us/img144/4743/smallvideo.png

 

However, when I play it directly through the media player it plays like this:

 

http://img144.imageshack.us/img144/8110/bigvideo.png

Developer
Posts: 49
Registered: ‎08-25-2009
My Device: Not Specified

Re: Options for video play back

Can we control the Next and Previous Buttons of Player?

On Next, some other given video gets played.

Please Help