Constructor Summary
Public Constructor | ||
public |
constructor(player: videojs.Player | Object, options: Object) The constructor function for the class. |
Member Summary
Public Members | ||
public |
|
|
public |
|
|
public |
audioBitRate: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
audioEngine: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
convertAuto: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
converter: * |
|
public |
countDown: * |
|
public |
debug: * |
|
public |
|
|
public |
|
|
public |
devices: *[] |
|
public |
|
|
public |
engine: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
maxFileSize: * |
|
public |
maxLength: * |
|
public |
mediaElement: * |
|
public |
mediaType: {"audio": *, "video": *} |
|
public |
|
|
public |
|
|
public |
pauseTime: * |
|
public |
|
|
public |
pausedTime: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
recordAudio: * |
|
public |
recordImage: * |
|
public |
recordScreen: * |
|
public |
|
|
public |
recordVideo: * |
|
public |
startTime: * |
|
public |
stream: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
surfer: * |
|
public |
videoBitRate: * |
|
public |
videoEngine: * |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Private Members | ||
private |
|
|
private |
_formatTime: * |
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
convert() Start converter. |
|
public |
destroy() Destroy plugin and players and cleanup resources. |
|
public |
dispose() Destroy plugin only. |
|
public |
Collects information about the media input and output devices available on the system. |
|
public |
exportImage(format: string, quality: number): Promise Export image data of waveform (audio-only) or current video frame. |
|
public |
getCurrentTime(): float Get the current time of the recorded stream during playback. |
|
public |
Open the browser's recording device selection dialog and start the device. |
|
public |
getDuration(): float Get the length of the recorded stream in seconds. |
|
public |
Get recorder type. |
|
public |
Indicates whether the plugin is destroyed or not. |
|
public |
Indicates whether the plugin is currently processing recorded data or not. |
|
public |
Indicates whether the plugin is currently recording or not. |
|
public |
Start loading data. |
|
public |
loadOptions(newOptions: Object) Setup plugin options. |
|
public |
muteTracks(mute: boolean) Mute LocalMediaStream audio and video tracks. |
|
public |
pause() Pause recording. |
|
public |
reset() Reset the plugin. |
|
public |
resume() Resume recording. |
|
public |
Show save as dialog in browser so the user can store the recorded or converted media locally. |
|
public |
setAudioInput(deviceId: string) Change the audio input device. |
|
public |
setAudioOutput(deviceId: string) Change the audio output device. |
|
public |
setFormatTime(customImplementation: function) Replaces the default |
|
public |
setVideoInput(deviceId: string) Change the video input device. |
|
public |
start() Start recording. |
|
public |
stop() Stop recording. |
|
public |
Stop device(s) and recording if active. |
|
public |
Stop stream and device. |
Private Methods | ||
private |
captureFrame(): void Capture frame from camera and copy data to canvas. |
|
private |
Create and display snapshot image. |
|
private |
Display snapshot image. |
|
private |
displayVolumeControl(display: boolean) Show or hide the volume menu. |
|
private |
drawCanvas(canvas: HTMLCanvasElement, element: HTMLElement, width: Number, height: Number, x: Number, y: Number) Draw image frame on canvas element. |
|
private |
Hide animated GIF. |
|
private |
Invoked during recording and displays the remaining time. |
|
private |
onDeviceError(code: string | number) Invoked when an device error occurred. |
|
private |
onDeviceReady(stream: LocalMediaStream) Invoked when the device is ready. |
|
private |
onEnterPiP(event: object) Invoked when entering picture-in-picture mode. |
|
private |
onLeavePiP(event: object) Invoked when leaving picture-in-picture mode. |
|
private |
Invoked when recording completed and the resulting stream is available. |
|
private |
onStreamVisible(event: Event) Invoked when the video device is ready and stream is visible. |
|
private |
Update time during playback. |
|
private |
Removes recorded |
|
private |
Reset the plugin recorder state. |
|
private |
Reset UI for retrying a snapshot image. |
|
private |
setCurrentTime(currentTime: number, duration: number) Updates the player's element displaying the current time. |
|
private |
setDuration(duration: number) Updates the player's element displaying the duration time. |
|
private |
setupUI() Player UI is ready. |
|
private |
Show animated GIF. |
|
private |
Start recording. |
|
private |
Start preview of video stream. |
Public Constructors
Public Members
public animationFrameRate: * source
public animationQuality: * source
public audioBitRate: * source
public audioBufferSize: * source
public audioBufferUpdate: * source
public audioChannels: * source
public audioEngine: * source
public audioMimeType: * source
public audioRecorderType: * source
public audioSampleRate: * source
public audioWebAssemblyURL: * source
public audioWorkerURL: * source
public autoMuteDevice: * source
public convertAuto: * source
public convertEngine: * source
public convertOptions: * source
public convertWorkerURL: * source
public converter: * source
public countDown: * source
public debug: * source
public deviceErrorCallback: * source
public deviceReadyCallback: * source
public devices: *[] source
public displayMilliseconds: * source
public engine: * source
public engineStopCallback: * source
public imageOutputFormat: * source
public imageOutputQuality: * source
public imageOutputType: * source
public maxFileSize: * source
public maxLength: * source
public mediaElement: * source
public mediaType: {"audio": *, "video": *} source
public onEnterPiPHandler: * source
public onLeavePiPHandler: * source
public pauseTime: * source
public pausedTime: * source
public pluginLibraryOptions: * source
public recordAnimation: * source
public recordAudio: * source
public recordImage: * source
public recordScreen: * source
public recordTimeSlice: * source
public recordVideo: * source
public startTime: * source
public stream: * source
public streamCurrentTime: * source
public streamDuration: * source
public streamVisibleCallback: * source
public surfer: * source
public videoBitRate: * source
public videoEngine: * source
public videoFrameHeight: * source
public videoFrameRate: * source
public videoFrameWidth: * source
public videoMimeType: * source
public videoRecorderType: * source
public videoWebAssemblyURL: * source
public videoWorkerURL: * source
Private Members
private _formatTime: * source
Public Methods
public dispose() source
Destroy plugin only.
Use [destroy]Record#destroy to remove the plugin and the player as well.
public enumerateDevices() source
Collects information about the media input and output devices available on the system.
public exportImage(format: string, quality: number): Promise source
Export image data of waveform (audio-only) or current video frame.
The default format is 'image/png'
. Other supported types are
'image/jpeg'
and 'image/webp'
.
Params:
Name | Type | Attribute | Description |
format | string |
|
A string indicating the image format.
The default format type is |
quality | number |
|
A number between 0 and 1 indicating the image
quality to use for image formats that use lossy compression such as
|
public getCurrentTime(): float source
Get the current time of the recorded stream during playback.
Returns 0 if no recording is available (yet).
Return:
float | Current time of the recorded stream. |
public getDevice() source
Open the browser's recording device selection dialog and start the device.
public getDuration(): float source
Get the length of the recorded stream in seconds.
Returns 0 if no recording is available (yet).
Return:
float | Duration of the recorded stream. |
public getRecordType(): string source
Get recorder type.
Example:
console.log(player.record().getRecordType()); // 'audio_video'
public isProcessing(): boolean source
Indicates whether the plugin is currently processing recorded data or not.
public load(url: string | blob | file) source
Start loading data.
Params:
Name | Type | Attribute | Description |
url | string | blob | file | Either the URL of the media file, a Blob, a File object or MediaStream. |
public loadOptions(newOptions: Object) source
Setup plugin options.
Params:
Name | Type | Attribute | Description |
newOptions | Object | Optional new player options. |
public muteTracks(mute: boolean) source
Mute LocalMediaStream audio and video tracks.
Params:
Name | Type | Attribute | Description |
mute | boolean | Whether or not the mute the track(s). |
public saveAs(name: Object, type: String): void source
Show save as dialog in browser so the user can store the recorded or converted media locally.
Params:
Name | Type | Attribute | Description |
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'. |
|
type | String | Type of media to save. Legal values are 'record' (default) and 'convert'. |
Return:
void |
Example:
// save recorded video file as 'foo.webm'
player.record().saveAs({'video': 'foo'});
// save converted video file as 'bar.mp4'
player.record().saveAs({'video': 'bar'}, 'convert');
public setAudioInput(deviceId: string) source
Change the audio input device.
Params:
Name | Type | Attribute | Description |
deviceId | string | Id of the audio input device. |
public setAudioOutput(deviceId: string) source
Change the audio output device.
Params:
Name | Type | Attribute | Description |
deviceId | string | Id of audio output device. |
public setFormatTime(customImplementation: function) source
Replaces the default formatTime
implementation with a custom implementation.
Params:
Name | Type | Attribute | Description |
customImplementation | function | A function which will be used in place
of the default |
public setVideoInput(deviceId: string) source
Change the video input device.
Params:
Name | Type | Attribute | Description |
deviceId | string | Id of the video input device. |
Private Methods
private displayVolumeControl(display: boolean) source
Show or hide the volume menu.
Params:
Name | Type | Attribute | Description |
display | boolean | Hide/show volume control. |
private drawCanvas(canvas: HTMLCanvasElement, element: HTMLElement, width: Number, height: Number, x: Number, y: Number) source
Draw image frame on canvas element.
Params:
Name | Type | Attribute | Description |
canvas | HTMLCanvasElement | Canvas to draw on. |
|
element | HTMLElement | Element to draw onto the canvas. |
|
width | Number | Width of drawing on canvas. |
|
height | Number | Height of drawing on canvas. |
|
x | Number | X position on canvas where drawing starts. |
|
y | Number | Y position on canvas where drawing starts. |
private onDeviceReady(stream: LocalMediaStream) source
Invoked when the device is ready.
Params:
Name | Type | Attribute | Description |
stream | LocalMediaStream | Local media stream from device. |
private onEnterPiP(event: object) source
Invoked when entering picture-in-picture mode.
Params:
Name | Type | Attribute | Description |
event | object | Event data. |
private onLeavePiP(event: object) source
Invoked when leaving picture-in-picture mode.
Params:
Name | Type | Attribute | Description |
event | object | Event data. |
private onRecordComplete() source
Invoked when recording completed and the resulting stream is available.
private onStreamVisible(event: Event) source
Invoked when the video device is ready and stream is visible.
Params:
Name | Type | Attribute | Description |
event | Event |
|
private setCurrentTime(currentTime: number, duration: number) source
Updates the player's element displaying the current time.