but when i transfer this video file on desktop.after converting it into another format ,may be mp4,3gp.it is playing well
so plz help me regarding this issue.
m using following code:
String PATH = System.getProperty("fileconn.dir.videos") + "vidoe.3gp";
videoEncodings = System.getProperty("video.encodings");
final boolean hasVideoRecording = videoEncodings != null
&& videoEncodings.length() > 0;
if (player == null || recorder == null)
{
if (hasVideoRecording)
{
int encodingSpace = videoEncodings
.indexOf(' ');
if (encodingSpace != -1)
{
videoEncodings = videoEncodings
.substring(0, encodingSpace);
}
player = Manager
.createPlayer("capture://video?"
+ videoEncodings);
player.start();
VideoControl video = (VideoControl) player
.getControl("VideoControl");
final Field cameraView = (Field) video
.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE,
"net.rim.device.api.ui.Field");
getApplication().invokeLater(new Runnable()
{
public void run()
{
add(cameraView);
}
});
}
else
{
player = Manager
.createPlayer("capture://audio");
player.start();
}
recorder = (RecordControl) player
.getControl("RecordControl");
}
conn = (FileConnection)Connector.open(PATH,Connector.READ _WRITE);
if(!conn.exists())
conn.create();
OutputStream b=conn.openDataOutputStream();
recorder.setRecordStream(b);
recorder.startRecord();
recording = true;
Thread.currentThread().sleep(1000);
recorder.stopRecord();
recorder.commit();
recorder.close();
recording = false;
player.stop();
b.close();
player.deallocate();
player.close();
conn.close();
}
Last edited by neha.chaudhary; 02-18-2010 at 11:54 AM..
|