Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VideoRecorder

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

see

https://doc.babylonjs.com/how_to/render_scene_on_a_video

Hierarchy

  • VideoRecorder

Index

Constructors

constructor

  • Create a new VideoCapture object which can help converting what you see in Babylon to a video file.

    Parameters

    • engine: Engine

      Defines the BabylonJS Engine you wish to record.

    • Optional options: Partial<VideoRecorderOptions>

      Defines options that can be used to customize the capture.

    Returns VideoRecorder

Accessors

isRecording

  • get isRecording(): boolean
  • True when a recording is already in progress.

    Returns boolean

Methods

disposeSearch playground for dispose

  • dispose(): void
  • Releases internal resources used during the recording.

    Returns void

startRecordingSearch playground for startRecording

  • startRecording(fileName?: Nullable<string>, maxDuration?: number): Promise<Blob>
  • Starts recording the canvas for a max duration specified in parameters.

    Parameters

    • Optional fileName: Nullable<string>

      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.

    • Optional maxDuration: number

      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.

stopRecordingSearch playground for stopRecording

  • stopRecording(): void
  • Stops the current recording before the default capture timeout passed in the startRecording function.

    Returns void

Static IsSupportedSearch playground for IsSupported

  • IsSupported(engine: Engine): boolean
  • Returns whether or not the VideoRecorder is available in your browser.

    Parameters

    • engine: Engine

      Defines the Babylon Engine.

    Returns boolean

    true if supported otherwise false.

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method