class MediaPlayer

Extends:
UIComponent

Description:

Media player is an audio and video player component capable of playing video & audio files, video & audio live streams, video & audio from URL, and from audio & video capture devices, like microphone, web cam and other video capture devices.
It's done with the help of pre-installed FFMPEG, so FFMPEG is required to be installed for this to work. FFMPEG is a free open-source software.

Constructor

constructor()

Initializes the MediaPlayer UI component.

Parameters:

No parameters

Members

Methods

From this class:

Inherited from UIComponent:

Examples:

Examples of formats of commonly used objects with media player:

VideoDevice {
    [name]: string,          // Name of the video input device.
    id: string,              // ID if the video input device.
    [formats]: VideoFormat[],// Available video formats (present only when getting video input devices)
    [format]: VideoFormat    // Chosen video format to use (required when setting a video input device).
}

VideoFormat {
     size: string,           // Video frame size in pixels
     pixel_format: string    // Frame image encoding coming out of the device (e.g.: "yuyv422")
     [fps]: number           // (required only when setting a video input device)
     [min_fps]: number,      // Minimum available frame rate. For example 7.5 fps.
     [max_fps]: number,      // Maximum available frame rate. For example 30 fps.
}

AudioDevice {
    [name]: string,              // Name of audio device.
    id: string,                  // ID of audio device. (required when setting an audio device).
    [formats]: AudioFormats[],   // Available audio formats (present only when getting audio devices).
    [format]: AudioFormat,       // Audio format to use (required when setting an audio device).
}

AudioFormat {
     channels: number,   // Audio channels available
     bits: number,       // Bits per sample
     [rate]: number,     // Sample rate in Hz. It's only used for audio input device formats (not output). Set it when setting an audio output device.
     [encoding]: string  // Audio encoding (e.g.: PCM_UNSIGNED, PCM_SIGNED). (Only available in audio output device formats).
}