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 Contributor
Posts: 4
Registered: ‎08-24-2011
My Device: Bold 9900
My Carrier: orange

VideoControl.setDisplayFullscreen() does not work on JDE 7.0 if video field is added to a ComponentCanvas manager.

Hello,

 

All the issue is in the title,here is extract of the code I wrote, in the main screen class of my RIMlet:

 

-----------------------------------------------------------------------------------

 

Player m_oPlayer = Manager.createPlayer("<media locator>");

 

m_oPlayer.realize();

AdvancedVideoControl m_oAdvancedVideoControl = (AdvancedVideoControl) m_oPlayer.getControl("net.rim.device.api.media.control.AdvancedVideoControl");

if (m_oAdvancedVideoControl != null)
{
   Field videoField = (Field) m_oAdvancedVideoControl.initDisplayMode(AdvancedVideoControl.USE_GUI_ADVANCED, "net.rim.device.api.ui.Field");
   m_oAdvancedVideoControl.setVisible(true);

 

   ComponentCanvas oComponentCanvas = new ComponentCanvas(Display.getWidth(), Display.getHeight());

 

   add(oComponentCanvas);

   oComponentCanvas.add(videoField, 0, 0);

 

   m_oPlayer.start();

 

   // The video start normally.

}

 

// Then, on a menu action for instance, if I execute:

m_oAdvancedVideoControl.setDisplayFullScreen(true)

 

// it has no effect on the video :-(

 

 

-----------------------------------------------------------------------------------

 

 

Is it a known limitation, and is there a workaround for this issue?

 

Thanks

 

BM

Retired
Retired
Posts: 150
Registered: ‎10-19-2010
My Device: Not Specified
My Carrier: Rogers

Re: VideoControl.setDisplayFullscreen() does not work on JDE 7.0 if video field is added to a ComponentCanvas manager.

Hi bmarty!

 

setDisplayFulScreen() should do nothing when using AdvancedVideoControl, by design.  When using the AdvancedVideoControl the dimensions are tied to the dimensions of it's parent field.  To set full screen resize the component canvas to full screen.  Your code shows the component canvas is Display.getWidth() by Display.getHeight() so the video should already be full screen when you add it. 

 

Can you verify if that is the case?  If not, it should be and we can fix that.  

 

On a side note, the line "AdvancedVideoControl m_oAdvancedVideoControl..." is assigning the control to a local variable and not a field which would mean your 'menu action' code itme won't see it.Is that intentional?

New Contributor
Posts: 4
Registered: ‎08-24-2011
My Device: Bold 9900
My Carrier: orange

Re: VideoControl.setDisplayFullscreen() does not work on JDE 7.0 if video field is added to a ComponentCanvas manager.

Hello BVP and thank you for your fast answer.

 

In fact, my video was not displayed in fullscreen by default, because I called

 

m_oAdvancedVideoControl.setDisplaySize(176,144);

 

In fact, I solve the issue by not using setDisplayFulScreen(), but by setting manually the video position to (0, 0) and video size to the size of screen.

 

Note that setDisplayFulScreen() does not work even if I initialize display mode with classical VideoControl.USE_GUI_PRIMITIVE.

 

About scope of variable m_oAdvancedVideoControl, you're right, I've just pasted the type in my code sample, but in 'real life', m_oAdvancedVideoControl is a member of the class :-)

 

Tanks again

 

BR

 

 

bmarty

Retired
Retired
Posts: 150
Registered: ‎10-19-2010
My Device: Not Specified
My Carrier: Rogers

Re: VideoControl.setDisplayFullscreen() does not work on JDE 7.0 if video field is added to a ComponentCanvas manager.

Hi BR!

 

That setDisp[laySize call was not in your code above, so now I understand.  Setting the video size to the screen dimensions worked in this case because the ComponentCanvas is also the screen size, and as I said the video will be bound by the dimensions of its parent field.

 

Thanks for trying setDisplayFulScreen() using VideoControl.USE_GUI_PRIMITIVE, I will take a look!