2012-05-28 54 views
0

我試圖捕捉到一個J2ME應用程序的視頻與下面的代碼段J2ME視頻拍攝拋出MediaException:無效的定位:捕捉://視頻

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它只會顯示相機的圖像只。我該如何解決這個問題?

回答

1

也許你會嘗試得到device name,就像devcam0/devcam1一樣?你使用諾基亞手機嗎?

+0

是的,我使用諾基亞手機 – jade

+0

我沒有在家裏找到有線的諾基亞。也許你可以使用這個:'player = Manager.createPlayer(「capture:// video」);' –