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

ConvertEngine

Extends:

Component → ConvertEngine

Base class for converter backends.

Constructor Summary

Public Constructor
public

constructor(player: Player, options: Object)

Creates an instance of this class.

Member Summary

Public Members
public

debug: *

public

Method Summary

Public Methods
public

addFileInfo(fileObj: Blob | File, now: date)

Add filename and timestamp to converted file object.

public

loadBlob(data: Blob): Promise

Load Blob and return Promise.

public

saveAs(name: Object)

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

public

setup(mediaType: Object, debug: Boolean)

Setup recording engine.

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 debug: * source

public mediaType: * source

Public Methods

public addFileInfo(fileObj: Blob | File, now: date) source

Add filename and timestamp to converted file object.

Params:

NameTypeAttributeDescription
fileObj Blob | File

Blob or File object to modify.

now date
  • optional

Optional date information, default is current timestamp.

public loadBlob(data: Blob): Promise source

Load Blob and return Promise.

Params:

NameTypeAttributeDescription
data Blob

Blob to load.

Return:

Promise

Promise with ArrayBuffer data.

public saveAs(name: Object) source

Show save as dialog in browser so the user can store the converted 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'.

public setup(mediaType: Object, debug: Boolean) source

Setup recording engine.

Params:

NameTypeAttributeDescription
mediaType Object

Object describing the media type of this engine.

debug Boolean

Indicating whether or not debug messages should be printed in the console.