A-Tractor - v2.5.6
    Preparing search index...

    Interface IMediaPlayerOptions

    Options for the MediaPlayer.

    interface IMediaPlayerOptions {
        analyzerClass?: AbstractAnalyzer;
        analyzerOptions?: any;
        autoHideAnalyzer?: number;
        autoHideControls?: number;
        buttonFullscreenClassOff?: string;
        buttonFullscreenClassOn?: string;
        buttonVolumeClassActive?: string;
        delayShowAfterTap?: number;
        enableButtonFullscreen?: boolean;
        events?: {
            changePosition?: (params: any) => void;
            changeVolume?: (params: any) => void;
            clickPoster?: (params: any) => void;
            ended?: (params: any) => void;
            enterFullscreen?: (params: any) => void;
            exitFullscreen?: (params: any) => void;
            pause?: (params: any) => void;
            play?: (params: any) => void;
        };
        mediaElement?: string
        | HTMLMediaElement;
        mediaSourcePreload?: TMediaSourcePreload;
        mediaStateOptions?: IMediaStateOptions;
        mediaTimePointerOptions?: IMediaTimePointerOptions;
        mediaType?: MediaType;
        position?: number;
        poster?: string;
        posterElementClass?: string | string[];
        posterHint?: string;
        removeMediaOnDestroy?: boolean;
        template?: string;
        videoElementClass?: string | string[];
        viewElement?: string | HTMLElement;
        viewElementClass?: string | string[];
        viewElementTag?: string;
        viewSelectors?: {
            analyzer?: string;
            buttonFullscreen?: string;
            buttonPlay?: string;
            buttonVolume?: string;
            controls?: string;
            poster?: string;
            timePointer?: string;
            timerDuration?: string;
            timerElapsed?: string;
            timerRemaining?: string;
            volumeLevel?: string;
            volumeSlider?: string;
            volumeValue?: string;
        };
        volume?: number;
    }
    Index

    Properties

    analyzerClass?: AbstractAnalyzer

    Class of audio analyzer to visualize audio.

    • For audio source is set to WaveformAnalyzer by default.
    • For video source is set to null by default and should be set manually if needed.
    analyzerOptions?: any

    Audio analyzer options if needed.

    autoHideAnalyzer?: number

    The number of seconds after which the analyzer is hidden during playback. By default, it is automatically set to 1 second for video only.

    autoHideControls?: number

    The number of seconds after which the controls are hidden during playback. By default, it is automatically set to 1 second for video only.

    buttonFullscreenClassOff?: string

    CSS class to add to buttonFullscreen when the element is not in the full screen mode. By default fullscreen-off.

    buttonFullscreenClassOn?: string

    CSS class to add to buttonFullscreen when the element is in the full screen mode. By default fullscreen-on.

    buttonVolumeClassActive?: string

    CSS class to add to buttonVolume element if panel with volumeSlider is open. By default active.

    delayShowAfterTap?: number

    The delay in seconds to display auto-hidden controls and the analyzer after the user taps the poster. By default, it is automatically set to 1 second for video only.

    enableButtonFullscreen?: boolean

    Force the Fullscreen button to appear.

    events?: {
        changePosition?: (params: any) => void;
        changeVolume?: (params: any) => void;
        clickPoster?: (params: any) => void;
        ended?: (params: any) => void;
        enterFullscreen?: (params: any) => void;
        exitFullscreen?: (params: any) => void;
        pause?: (params: any) => void;
        play?: (params: any) => void;
    }

    Hash array of Media player events to register callbacks.

    mediaElement?: string | HTMLMediaElement

    CSS selector or reference to the HTML media element taken as the source of media data. Auto created by default.

    mediaSourcePreload?: TMediaSourcePreload

    Strategy to preload media content. By default metadata.

    mediaStateOptions?: IMediaStateOptions

    MediaState component options if needed.

    mediaTimePointerOptions?: IMediaTimePointerOptions

    MediaTimePointer component options if needed.

    mediaType?: MediaType

    The type of media data created by default. By default MediaType.AUDIO.

    position?: number

    Initial time position offset in seconds.

    poster?: string

    URL of poster image for the media source.

    posterElementClass?: string | string[]

    CSS class to add to poster element. Can be specified as a list of class names or as a string containing class names separated by spaces.

    By default for video: frame-aspect-ratio-16x9 and for audio frame-aspect-ratio-4x3.

    posterHint?: string

    Hint for poster image.

    removeMediaOnDestroy?: boolean

    Possible cases:

    • TRUE means always remove media element when destroy method is called.
    • FALSE means never remove media element when destroy method is called.
    • UNDEFINED means remove media element only if it was automatically created.
    template?: string

    HTML template with Media player structure. By default defined by TEMPLATE_WITH_HORIZONTAL_VOLUME_SLIDER.

    videoElementClass?: string | string[]

    CSS class to add to auto created video element. Can be specified as a list of class names or as a string containing class names separated by spaces.

    By default poster.

    viewElement?: string | HTMLElement

    CSS selector or HTML container element to render player content. Auto created by default.

    viewElementClass?: string | string[]

    CSS class for player container HTML element. Can be specified as a list of class names or as a string containing class names separated by spaces.

    By default media-player-item.

    viewElementTag?: string

    Tag of player container HTML element. By default div.

    viewSelectors?: {
        analyzer?: string;
        buttonFullscreen?: string;
        buttonPlay?: string;
        buttonVolume?: string;
        controls?: string;
        poster?: string;
        timePointer?: string;
        timerDuration?: string;
        timerElapsed?: string;
        timerRemaining?: string;
        volumeLevel?: string;
        volumeSlider?: string;
        volumeValue?: string;
    }

    List of CSS selectors to bind view elements. May be redefined if custom template is used for Media player.

    Bindings by default:

    - poster: '.poster'
    - analyzer: '.analyzer'
    - controls: '.controls'
    - timePointer: '.time-pointer'
    - timerElapsed: '.timer.elapsed'
    - timerRemaining: '.timer.remaining'
    - timerDuration: '.timer.duration'
    - buttonPlay: '.button-play'
    - buttonVolume: '.button-volume'
    - volumeSlider: '.volume-slider'
    - volumeLevel: '.volume-level'
    - volumeValue: '.volume-value'
    
    volume?: number

    Initial media source volume. Value should be in range of [0 - 1] (it means: 0 - 100%).