Blackberry中的录像机问题

时间:2012-11-01 07:48:39

标签: video blackberry recorder

我已经在我的应用程序中实现了视频录制功能,并且除了BB Torch之外,它在OS版本6.0及更高版本的所有流行BB设备上都能正常工作。

在BB Torch中,录像机仅显示设备屏幕的一半。当我尝试设置displaySize或displayFullScreen时,它会抛出不支持这些功能的媒体异常。但在BB Bold / Curve等中,并没有抛出这个例外。

有没有办法解决这个问题?请帮助....提前致谢!!!

请在下面找到代码段。

public void videoPlayer() {
    try
    {
        // Start capturing video from the camera
        m_oPlayer = javax.microedition.media.Manager
                .createPlayer("capture://video?" + strEncoding);

        m_oPlayer.realize();

        m_oPlayer.start();
        m_oVideoControl = (VideoControl) m_oPlayer
                .getControl("VideoControl");

        m_oRecordControl = (RecordControl) m_oPlayer
                .getControl("RecordControl");

        m_oZoomControl = (ZoomControl) m_oPlayer
                .getControl("javax.microedition.amms.control.camera.ZoomControl");

        // Initialize the video display
        Field oVideoField = (Field) m_oVideoControl.initDisplayMode(
                VideoControl.USE_GUI_PRIMITIVE,
                "net.rim.device.api.ui.Field");
        /**
         * To make the video recorder layout fit the entire size of the device.
         */
        try {

            m_oVideoControl.setDisplaySize(Display.getWidth(), Display.getHeight());

        } catch (MediaException mex) {
            //System.out.println(mex);
            videoExceptionAction(mex.getMessage());
        }
        VerticalFieldManager oVfmMainManager = (VerticalFieldManager) this.getMainManager();
        oVfmMainManager.add(oVideoField);
        m_strVideoFile = strFilePath;
        m_oOutStream = new ByteArrayOutputStream();

    }
    catch (Exception e)
    {
        videoExceptionAction(e.getMessage());
    }
}

0 个答案:

没有答案