gpt4 book ai didi

java - 代号一限制用户只能录制3秒视频

转载 作者:行者123 更新时间:2023-11-30 07:20:49 24 4
gpt4 key购买 nike

我需要代号为一的用户录制的视频,我已经完成了。但我想限制用户录制长度不超过 3 秒的视频。

有什么方法可以在录制后剪切视频或者可以在3秒后停止录制吗?

最佳答案

我在另一个帖子上发现了这个,还没有经验,但这可能对你有帮助。

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);
}

我现在的方法是在这个时间前后加入一个 3 秒的计时器

UITimer timer = new UITimer(new Runnable() {
@Override
public void run() {
stopreRecord(true);
});
timer.schedule(3000, false, f);

关于java - 代号一限制用户只能录制3秒视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37608560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com