Home Reference Source
import {RecordEngine} from 'videojs-record/js/engine/record-engine.js'
public class | source

RecordEngine

Extends:

Component → RecordEngine

Indirect Subclass:

WebmWasmEngine

Base class for recorder backends.

Constructor Summary

Public Constructor
public

constructor(player: Player, options: Object)

Creates an instance of this class.

Member Summary

Public Members
public

Method Summary

Public Methods
public

addFileInfo(fileObj: Blob | File)

Add filename and timestamp to recorded file object.

public

Destroy engine.

public

saveAs(name: Object): void

Show save as dialog in browser so the user can store the recorded media locally.

Private Methods
private

Remove any temporary data and references to streams.

private

onStopRecording(data: blob)

Invoked when recording is stopped and resulting stream is available.

Public Constructors

public constructor(player: Player, options: Object) source

Creates an instance of this class.

Params:

NameTypeAttributeDescription
player Player

The Player that this class should be attached to.

options Object
  • optional

The key/value store of player options.

Public Members

public recordedData: * source

Public Methods

public addFileInfo(fileObj: Blob | File) source

Add filename and timestamp to recorded file object.

Params:

NameTypeAttributeDescription
fileObj Blob | File

Blob or File object to modify.

public destroy() source

Destroy engine.

public saveAs(name: Object): void source

Show save as dialog in browser so the user can store the recorded media locally.

Params:

NameTypeAttributeDescription
name Object

Object with names for the particular blob(s) you want to save. File extensions are added automatically. For example: {'video': 'name-of-video-file'}. Supported keys are 'audio', 'video' and 'gif'.

Return:

void

Example:

// save recorded video file as 'foo.webm'
player.record().saveAs({'video': 'foo'});

Private Methods

private dispose() source

Remove any temporary data and references to streams.

private onStopRecording(data: blob) source

Invoked when recording is stopped and resulting stream is available.

Params:

NameTypeAttributeDescription
data blob

Reference to the recorded Blob.