黑莓手机 - 可能隐藏视频场? [英] BlackBerry - Possible to Hide Video Field?
问题描述
我想写像手电筒的应用程序(与相机LED的帮助下)。
I want to write an application like a Flashlight (with the help of the camera LED).
Player player = javax.microedition.media.Manager.createPlayer("capture://video?encoding=video/3gpp");
player.realize();
VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
if(videoControl != null)
{
videoField = (Field)videoControl.initDisplayMode( VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field" );
try
{
videoControl.setDisplaySize(1, 1);
}
catch(Exception e)
{
PGLogUtil.logString(e.toString());
}
videoControl.setVisible(true);
add(videoField);
FlashControl flashControl = (FlashControl)
player.getControl("javax.microedition.amms.control.camera.FlashControl");
setFlashlight(true);
}
player.start();
上面的code完美的作品,但我想隐藏 videoField
。当我删除添加(videoField)
或使用 videoControl.setVisible(假)
,手电筒不工作。有人能解释为什么吗?
The code above works perfectly, but I want to hide the videoField
. When I removed add(videoField)
or use videoControl.setVisible(false)
, the flashlight does not work. Can someone explain why?
我怎么能转向灯与隐藏的 videoField
?
How I can turn lights on with a hidden videoField
?
推荐答案
我刚刚得到一个BB是有一个闪光我想尝试在这个同样的问题我的手。我终于得到它反正工作。
在事情我在整个测试时间观察是,如果像你说的videoField是隐藏的,闪光灯是行不通的......因此,关键我所做的就是
I just got a bb that had a flash i wanted to try my hands on this same issue. I finally got it to work anyway. On thing i observed during the whole testing time was that if the videoField is hidden like you said, the flash wouldn't work...So the trick i did was
<pre>
_videoControl.setDisplaySize( 1 , 1 );
</pre>
和那个做的工作对我来说。你还可将其设置为
And that did the job for me. You could as well set it to
<pre>
_videoControl.setDisplaySize( 0 , 0 );
</pre>
但是,不管你做什么......确保您设置
But whatever you do ... ensure you set
<pre>
_videoControl.setVisible(true);
</pre>
否则你的闪光灯将无法工作。
else your flash will not work
这篇关于黑莓手机 - 可能隐藏视频场?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!