Scratch for Java

Recorder()

Browser availability: desktop-only.

This API requires the desktop runtime. Browser declarations may report the limitation without performing the operation.

The Recorder class provides a framework for recording frames to a file. It includes methods to start and stop the recording process, and an abstract method saveFrame() that must be implemented by subclasses to define the specific behavior for saving a frame.

This class is intended to be extended by other classes that provide concrete implementations for saving frames in different formats.

Example usage:

public class MyRecorder extends Recorder {
    public MyRecorder(String path, String ext) {
        super(path, ext);
    }
 
    @Override
    public void saveFrame() {
        // Implementation for saving a frame
    }
}

Note: The Recorder class uses the Applet class to register a method that is called after each frame is drawn. This ensures that frames are saved at the appropriate time during the recording process.

Syntax

Java

new Recorder(path, ext)
Recorder()

Create Shareable URL

Select Sections