我试图使用以下代码片段在 J2ME 应用程序中捕获视频
private void createCamera() throws IOException, MediaException {
videoComponent = VideoComponent.createVideoPeer("capture://video");
videoComponent.setPreferredH(height);
videoComponent.setPreferredW(cameraForm.getWidth());
player = (Player) videoComponent.getNativePeer();
player.realize();
player.prefetch();
videoControl = (VideoControl) player.getControl("VideoControl");
}
当我在真实设备上运行应用程序时,出现错误:
javax.microedition.media.MediaException: Invalid locator: capture://video
如果我使用字符串 capture://image 它只会显示相机的图像。我该如何解决这个问题?