双击打开HTML文件。播放器屏幕是黑色的,如果我点击播放按钮,它会直接跳到最后。但是,如果我拖动视频播放器的手柄,我可以从屏幕上的视频中看到一些镜头。
这是HTML文件:
<!DOCTYPE html>
<html>
<body>
<video width="400" controls="controls">
<source src="video.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
</body>
</html>
这是视频生成Java代码:
private LinkedList<BufferedImage> buffer;
...
public void saveVideo (File f) throws IOException {
if (converting) return;
System.out.println("Attempting to save video");
synchronized (lock) {
System.out.println("Starting the conversation");
converting = true;
SequenceEncoder enc = new SequenceEncoder(f);
while(!buffer.isEmpty()) {
BufferedImage image = buffer.getFirst();
buffer.removeFirst();
enc.encodeImage(image);
}
enc.finish();
System.out.println("Finished the conversation");
converting = false;
}
}