我需要从用户录制的视频在codename one做这件事。但我想限制用户不能录制长度超过3 seconds的视频。
有没有办法在录制后剪切视频,或者我可以在3秒后停止录制。
发布于 2016-06-03 16:13:21
我在另一个线程上找到了这个,还没有经验,但这可能会对你有帮助。
Media = MediaManager.createMediaRecorder("filename.xyz", MediaManager.getMediaRecorderingMimeType());
Button doneButton = new Button("DONE");
doneButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
stopRecord(false);
}
});
public void stopRecord(boolean timeElapsed)
{
answertiming.cancel();
media.pause();
media.cleanup();
if(timeElapsed)
Dialog.show("SUCCESS","Your time is up system has saved your answer, The file path for the recording is " + p, "OK",null);
else
Dialog.show("SUCCESS","You have successfully answered the question System has saved your answer, The file path for the recording is " + p, "OK",null);
}我现在的方法是在这个f.e周围设置一个3秒的计时器。
UITimer timer = new UITimer(new Runnable() {
@Override
public void run() {
stopreRecord(true);
});
timer.schedule(3000, false, f);发布于 2016-06-04 12:45:00
目前,除了使用本机接口功能与本机OS http://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html集成之外,没有其他方法可以在代号1中实现这一点
https://stackoverflow.com/questions/37608560
复制相似问题