【发布时间】:2017-06-02 17:11:05
【问题描述】:
好的,我有这个方法应该运行一个视频,等到它结束,然后播放第二个视频。
我的问题是程序似乎没有等待第一个视频结束,因此直接跳转到第二个视频。
我添加了 wait() 方法,它会导致第一个视频播放,但随后它停止并且第二个视频永远不会开始。
任何帮助将不胜感激!
private void test(ActionEvent event) throws InterruptedException {
File fi= new File("test\\firstVideo.mp4");
String filePath= fi.toURI().toString();
openFile(filePath);
wait(5000); //even wait(0) has the same effect
fi= new File("test\\secondVideo.mp4");
filePath= fi.toURI().toString();
openFile(filePath);
}
【问题讨论】:
-
我没有实现它,我只是写了 wait(5000)