Class VideoRecorder
Constructors
constructor
-
Create a new VideoCapture object which can help converting what you see in Babylon to a video file.
Parameters
- engine: AbstractEngine
Defines the BabylonJS Engine you wish to record.
- options: Partial<VideoRecorderOptions> = {}
Defines options that can be used to customize the capture.
Returns VideoRecorder
- engine: AbstractEngine
Accessors
is Recording
-
get isRecording(): boolean
True when a recording is already in progress.
Returns boolean
Methods
dispose
-
Releases internal resources used during the recording.
Returns void
start Recording
-
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.
- fileName: Nullable<string> = "babylonjs.webm"
stop Recording
-
Stops the current recording before the default capture timeout passed in the startRecording function.
Returns void
StaticIs Supported
-
Returns whether or not the VideoRecorder is available in your browser.
Parameters
- engine: AbstractEngine
Defines the Babylon Engine.
Optionalcanvas: HTMLCanvasElementDefines the canvas to record. If not provided, the engine canvas will be used.
Returns boolean
true if supported otherwise false.
- engine: AbstractEngine
This can help with recording videos from BabylonJS. This is based on the available WebRTC functionalities of the browser.
See
https://doc.babylonjs.com/features/featuresDeepDive/scene/renderToVideo