BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   make more than one clip while recording (http://www.blackberryforums.com/developer-forum/221548-make-more-than-one-clip-while-recording.html)

neha.chaudhary 03-10-2010 02:37 AM

make more than one clip while recording
 
hi !

how to make more than one video clip,while recording.
is it possible using for loop?

i m using following code to record one clip:

private class StartRecordingThread extends Thread
{
public void run()
{
try{

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");
cameraView = (Field) video
.initDisplayMode(
VideoControl.USE_GUI_PRIMITIVE,
"net.rim.device.api.ui.Field");
getApplication().invokeLater(new Runnable()
{
public void run()
{
add(cameraView);
}
});

}

recorder = (RecordControl) player
.getControl("RecordControl");
}


String PATH = System.getProperty("fileconn.dir.videos") + "video.3gp";
conn = (FileConnection)Connector.open(PATH,Connector.READ _WRITE);
if(!conn.exists())
conn.create();
conn.truncate(0);
// conn.close();

OutputStream out=conn.openDataOutputStream();
recorder.setRecordStream(out);
recorder.startRecord();
recording = true;
Thread.currentThread().sleep(15000);
recorder.stopRecord();
recorder.commit();
recording = false;
out.close();
conn.close();

player.stop();
player.deallocate();
player.close();
//conn.close();//end of fro loop
}
catch (Throwable t)
{
Dialog.alert(t.getMessage());
t.printStackTrace();
}
}

}


All times are GMT -5. The time now is 08:37 PM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.