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
New Developer
Posts: 33
Registered: ‎08-04-2010
My Device: Not Specified

Video Controls for video playback

I am new to blackberry development and have ran into an issue that has stumped me for quite some time. My app provides a couple of buttons that are linked to a server that is streaming live video via rtsp. I have the video playing well, but the only thing is that there is no controls (for play/pause, or volume). On the blackberry, when I go to the browser and enter the URL, it plays the video and you can pause the video and everything normally. Here is the section for playing the video:

 

videoPlayer = Manager.createPlayer(path);			
videoPlayer.realize();
videoPlayer.prefetch();
vc = (VideoControl)videoPlayer.getControl("VideoControl");

Field videoField = (Field)vc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");

add(videoField);
vc.setVisible(true);

videoPlayer.getControls();
videoPlayer.start();

I have tried several other variations of using the videoControl (found in other post) but with no success. I know this might be a simple no brainer, but I am a noob and im stumped. The main thing I need to add is a way for the user to pause the video. Volume isn't a big deal. Is there a way to get this working?

 

Also, are there any disadvantages to just invoking the browser to play the video? Or is that really the easier and best way? Thanks for any help.

 

New Developer
Posts: 33
Registered: ‎08-04-2010
My Device: Not Specified

Re: Video Controls for video playback

Just wanted to bump this thread. I have a deadline coming soon and I need to get this figured out so I can move on. Also I'm not sure if it really matters what device I'm testing on, but I have been using the BlackBerry 9550.

 

How long does it usually take to get the signature keys from BlackBerry. I filled out the form online yesterday (August 3rd) and still haven't heard nothing back from them. I purchased the keys incase I can't figure this videoControl out, atleast I'll be able to invoke the browser. Thanks again for any help you can provide.

Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: Video Controls for video playback

Have you checked out the CameraDemo that comes with the JDE 5.0?

New Developer
Posts: 33
Registered: ‎08-04-2010
My Device: Not Specified

Re: Video Controls for video playback

[ Edited ]

I just looked over it, and I'm not seeing anything that would help my situation. My code looks alot like the "initializeCamera" method in the example.

 

Does it matter that I'm streaming video from a server, rather than using the phones camera? Is this something you have used before? Ive looked at alot of example online the past day or so and my code looks very similar to everyone elses. I bet its probably something simple that I'm just missing but I can't figure it out. Thanks for the reply.

New Developer
Posts: 33
Registered: ‎08-04-2010
My Device: Not Specified

Re: Video Controls for video playback

Does anybody have any other ideas? I have been looking at the embededmediademo and have it working like that, but I need a way to lock the orientation of the screen. The only way I have found to do that is by extending the MIDlet class. But since im already extending MainScreen so I need to find a way without using MIDlets. Here is the code for the orientation:

 

 

DirectionControl dc = (DirectionControl)((Controllable)Display.getDisplay(this)).getControl("net.rim.device.api.lcdui.control.DirectionControl");

int directions = DirectionControl.DIRECTION_EAST | DirectionControl.DIRECTION_WEST;

dc.setAcceptableScreenDirections(directions);

This is the MIDlet method, so it is not recognizing ".getDisplay()". Anyone have any pointers for the orientation or another way of adding the controls?

 

Developer
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Video Controls for video playback