내 응용 프로그램에 amd save a video를 기록하고 싶습니다. 포럼에 많은 정보가 없습니다.Blackberry 응용 프로그램에 비디오 녹화하기
"Invoke.invokeApplication (Invoke.APP_TYPE_CAMERA, new CameraArguments());"와 같은 카메라를 호출하고 싶지 않습니다.
다음과 같은 코드가 나에게 http://docs.blackberry.com/en/developers/deliverables/17968/Record_video_to_a_file_in_a_BB_device_app_1222784_11.jsp
내가 시작, 중지 내가하려고하면 비디오를 저장하고 "지원되지 않는 포맷"라는 비디오를 재생까지 와서 빈 화면을 제공합니다이며, 지원되는 모든 형식을 얻을 수있는 방법이 있으며 모든 비디오 형식의 목록이 있습니까? 내 코드 : 내가 실수를 할 경우
public class MyScreen extends MainScreen{
String PATH;
RecordControl _recordControl;
Player _player;
MenuItem RecordVideo;
MenuItem StopVideo;
MenuItem SaveVideo;
public MyScreen() {
try {
_player = javax.microedition.media.Manager.createPlayer("capture://video?encoding=video/3gpp");
_player.realize();
VideoControl videoControl = (VideoControl) _player.getControl("VideoControl");
_recordControl = (RecordControl) _player.getControl("RecordControl");
Field videoField = (Field) videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
try{
videoControl.setDisplaySize(Display.getWidth(), Display.getHeight());
}catch(MediaException me){
Dialog.alert("Display size not supported");
}
add(videoField);
_recordControl.setRecordLocation("file:///store/home/user/videos/VideoRecordingTest.3gpp");
_player.start();
_recordControl.startRecord();
}catch(IOException e){
Dialog.alert(e.toString());
} catch(MediaException e){
Dialog.alert(e.toString());
}
RecordVideo = new MenuItem("Start Recording", 0, 0){
public void run() {
try {
_player.start();
_recordControl.startRecord();
} catch (MediaException e) {
Dialog.alert("Error Starting recording");
e.printStackTrace();
}
}
};
StopVideo = new MenuItem("Stop Recording", 0, 0){
public void run() {
try {
_player.stop();
} catch (MediaException e) {
Dialog.alert("Error Stopping recording");
e.printStackTrace();
}
}
};
SaveVideo = new MenuItem("Save Video", 0, 0){
public void run() {
try {
// Create an invocation instance with the specified URL where the file type is one of the media types supported by the media player.
Invocation invocation = new Invocation("file:///SDCard/BlackBerry/music/001.mp3");
// Get the Registry object using the class name of the application
Registry _registry=Registry.getRegistry(Application.getApplication().getClass().getName());
//Invoke the content handler.
_registry.invoke(invocation);
} catch (IOException e)
{ }
}
};
}
public void stop() {
if (_player != null){
_player.close();
_player = null;
}
if (_recordControl != null){
_recordControl.stopRecord();
try {
_recordControl.commit();
}
catch (Exception e)
{
Dialog.alert(e.toString());
}
_recordControl = null;
}
}
protected void makeMenu(Menu menu, int instance) {
ContextMenu contextMenu = ContextMenu.getInstance();
contextMenu.setTarget(this);
contextMenu.clear();
this.makeContextMenu(contextMenu);
menu.deleteAll();
menu.add(contextMenu);
}
public void makeContextMenu(ContextMenu contextMenu) {
contextMenu.addItem(MenuItem.separator(32));
contextMenu.addItem(RecordVideo);
contextMenu.addItem(StopVideo);
contextMenu.addItem(SaveVideo);
}
}
남자는, 메뉴 저장 항목은 정말뿐만 아니라 저장되지는 비디오 파일에 일부 관련이없는을 열려고한다. 내가 주석 섹션없이 깨끗한 코드를보고 싶습니다 –