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
Trusted Contributor
Posts: 145
Registered: ‎05-01-2011
My Device: 9780
My Carrier: Developer

Video not played in touch simulator & device

Hi,

 

    I am developing an application which contains video play, below is my code

 

final Player player = Manager.createPlayer(connectionUrl);

player.realize();

if ((control = (VideoControl) player.getControl("VideoControl")) != null) {
                control.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, canvas);
                flag = true;
                control.setDisplayFullScreen(true);
                control.setVisible(true);
                player.prefetch();
                player.start();
            }

 

and am developing two seperate builds one for touch & another one for non-touch. This same code is working fine in non-touch simulators and non-touch device 9780 bold.

 

But when I tested this in touch it just plays the voice and instead of video it just shows a blank page and I have a timer bar in the bottom its also moving.

 

& to make sure instead of the above coding I just called

 

Browser.getDefaultSession().displayPage(connectionUrl) - for this also the touch simulator just opens up the browser and then opens up the media player which plays the audio and timer bar moves but the video is not played at all.

 

Can anyone help me to resolve this?

 

Thanks.

Highlighted
Trusted Contributor
Posts: 145
Registered: ‎05-01-2011
My Device: 9780
My Carrier: Developer

Re: Video not played in touch simulator & device

Anyone help me?

Trusted Contributor
Posts: 224
Registered: ‎08-09-2011
My Device: 9550
My Carrier: BBprogrammer

Re: Video not played in touch simulator & device

Hii ,

 

  Can you try this One!!

 

 

_player = Manager.createPlayer(video.getURL());
if(_player!=null){
_player.realize();
VideoControl videoControl = (VideoControl) _player
.getControl("VideoControl");
Field field = (Field) videoControl.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE,
"net.rim.device.api.ui.Field");
field.setPadding(PADDING, PADDING, PADDING, PADDING);
videoControl.setDisplayLocation(PADDING, PADDING);
videoControl.setDisplaySize(videoWidth, videoHeight);
videoControl.setVisible(true);

 

 

Trusted Contributor
Posts: 145
Registered: ‎05-01-2011
My Device: 9780
My Carrier: Developer

Re: Video not played in touch simulator & device

No

 

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

 

this one is also not working..

 

When I create the player using the video from SDCard like

Player player = javax.microedition.media.Manager.createPlayer("file:///SDCard/**bleep**.mov");

 

Both the 

USE_DIRECT_VIDEO with canvas and USE_GUI_PRIMITIVE with field both are working but when I create the player by

Player player = Manager.createPlayer(connectionStringUrl); 

 

There is a blank screen and the video is not coming but I can hear the audio and the timer bar is moving and this is only for touch simulator and touch device the same code works fine in non-touch simulator and device...

 

Also I have separately hit the video play url which I've given as input from browser the video plays very well.

 

What is wrong with the code? Anyone help me??