2

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

0 に答える 0