API

Class VideoRecorder

This can help with recording videos from BabylonJS. This is based on the available WebRTC functionalities of the browser.

Index
  • Starts recording the canvas for a max duration specified in parameters.

    Parameters

    • fileName: Nullable<string> = "babylonjs.webm"

      Defines the name of the file to be downloaded when the recording stop. If null no automatic download will start and you can rely on the promise to get the data back.

    • maxDuration: number = 7

      Defines the maximum recording time in seconds. It defaults to 7 seconds. A value of zero will not stop automatically, you would need to call stopRecording manually.

    Returns Promise<Blob>

    A promise callback at the end of the recording with the video data in Blob.

  • Returns whether or not the VideoRecorder is available in your browser.

    Parameters

    • engine: AbstractEngine

      Defines the Babylon Engine.

    • Optionalcanvas: HTMLCanvasElement

      Defines the canvas to record. If not provided, the engine canvas will be used.

    Returns boolean

    true if supported otherwise false.