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

Regular Contributor
Posts: 55
Registered: ‎09-01-2010
My Device: Not Specified

Blackberry video thumbnail display prob

In my Blackberry app, I want to display a screen with a video and a lebel field. I am using the following code for video display and auto play.

    VerticalFieldManager vfm = new VerticalFieldManager();
    Player player = javax.microedition.media.Manager.createPlayer("file:///SDCard/BlackBerry/videos/sample.3gp");
    videoControl = (VideoControl) player.getControl("VideoControl");
    Field videoField = (Field) videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE,"net.rim.device.api.ui.Field");
    VolumeControl volume = (VolumeControl) player.getControl("VolumeControl");

It is working well. But, when the video is over, it is showing a black screen, but I want to display the first screen when the display is over and video can be replayed if user wants.

What change is needed in my code to achieve this feature?

BlackBerry Development Advisor
Posts: 15,882
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Blackberry video thumbnail display prob

You can use a PlayerListener to be informed when the video playback has stopped.  You could then redisplay your original screen when you receive that event.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Regular Contributor
Posts: 55
Registered: ‎09-01-2010
My Device: Not Specified

Re: Blackberry video thumbnail display prob

I got your point, by adding PlayerListener, I can identify the END_OF_MEDIA, after that how to show the thumbnail?