I need to record a video with a specific resolution (as little as possible).
private void startRecording(Player player, net.rim.device.api.ui.Manager parentManager) { try { if (player == null) { player = javax.microedition.media.Manager.createPlayer("capture://video?encoding=video/3gpp"); player.addPlayerListener(this); player.realize(); RecordControl recordControl = (RecordControl) player.getControl("RecordControl"); VideoControl videoControl = (VideoControl) player.getControl("VideoControl"); if (videoControl != null) { final Field videoField = (Field)videoControl.initDisplayMode( VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field" ); try { videoControl.setDisplaySize(1, 1); }catch(Exception e) { System.out.println(e); } videoControl.setVisible(true); UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { if(parentManager != null) { if(videoField.getIndex() == -1) { parentManager.insert(videoField, 1); } } } }); } }
but for some reason (CameraControl) player.getControl("CameraControl"); return null
How can I specify the permission to record video?
PS Blackberry OS 5.0 Torch 9800
Update:
If i use
capture:
or
capture:
I get event=error and eventData=2 in the PlayerListener.playerUpdate(Player player, String event, Object eventData) method
Description for eventData=2 I found here :
Invalid parameter: The parameter was specified with an invalid value.
Can someone explain to me why my parameters are wrong?
source share