Class: Video

PD. Video


new Video()

A static class for creating animated videos.

Author:
  • drajmarsh

Members


:Timer

_delayTimer <static>

Stores the current delay countdown timer.

Type
  • Timer

:string

filePrefix <static>

The name to prefix downloaded video files with, defaults to 'pd-video'.

Type
  • string

:string

format <static>

The video format and codec to record to, defaults to 'webm'.

Type
  • string

:number

frameRate <static>

The number of frames per second when capturing videos, defaults to 25 fps.

Type
  • number

:boolean

includeAudio <static>

Whether or not to include audio in the recording, defaults to false.

Type
  • boolean

:boolean

includeCursor <static>

Whether or not to include a cursor arrow, defaults to true.

Type
  • boolean

:number

resolution <static>

The preferred scaled resolution of the video in pixels, defaults to source resolution (1:1).

Type
  • number

:string

source <static>

The source to record video from, defaults to 'canvas'.

Type
  • string

Methods


_getAllSupportedMimeTypes(media) <static>

Checks a range of media types and codecs for video or audio.

Parameters:
Name Type Description
media string

The media type to check for ('audio'|'video'), defaults to 'video'.

Returns:

Returns an array of supported media mime types.

Type
Array.<string>

_getBestVideoFormat() <static>

Test for the best format and codec.

Returns:

Returns a mime type with codecs.

Type
string

abort() <static>

Aborts a recording without saving.


delayedStart(delay) <static>

Checks for a delay and displays countdown.

Parameters:
Name Type Description
delay number

The delay before starting, in milliseconds (0 to 20000).


getSupportedVideoFormats() <static>

Does an initial check to see what video formats are supported.

Returns:

Returns a formatted {name, value} options list.

Type
Array

pause() <static>

Pauses a recording.


recordCanvas( [canvas] [, name]) <static>

Captures a video of the given canvas.

Parameters:
Name Type Argument Description
canvas HTMLCanvasElement <optional>

The canvas to capture video from, defaults to the current scene canvas.

name string <optional>

The name to prefix the saved video file, defaults to PD.Video.filePrefix.


recordScreen(name) <static>

Captures a video of a window on the screen.

Parameters:
Name Type Description
name string

The name to prefix the save video file.


recordScreenWithAudio(name) <static>

Captures a video of the browser window with audio.

Parameters:
Name Type Description
name string

The name to prefix the save video file.


recordSource() <static>

Captures a video or selected source.


resume() <static>

Resumes a paused recording.


start() <static>

Starts recording and update application status.


stop() <static>

Stops recording and saves the video.