interface VideoApi {
    onBuffering$: Observable<VideoBufferingEvent>;
    onEnded$: Observable<VideoEndedEvent>;
    onFullscreenChange$: Observable<VideoFullscreenChangeEvent>;
    onPause$: Observable<VideoPlayEvent>;
    onPlay$: Observable<VideoPlayEvent>;
    onPlaybackRateChange$: Observable<VideoPlaybackRateEvent>;
    onSeeked$: Observable<VideoSeekedEvent>;
    onSeeking$: Observable<VideoSeekingEvent>;
    onVideoError$: Observable<VideoErrorEvent>;
    onVideoLoaded$: BehaviorSubject<undefined | VideoLoadedEvent>;
    onVideoLoading$: Observable<VideoLoadingEvent>;
    onVideoSafeZoneChange$: Observable<VideoSafeZoneChangeEvent>;
    onVideoTimeChange$: Observable<VideoTimeChangeEvent>;
    onVideoWindowPlaybackStateChange$: Observable<VideoWindowPlaybackStateChangeEvent>;
    onVolumeChange$: Observable<VideoVolumeEvent>;
    addSafeZone(videoSafeZone: VideoSafeZone): Observable<VideoSafeZone>;
    appendHelpMenuGroup(helpMenuGroup: HelpMenuGroup): Observable<void>;
    attachVideoWindow(): Observable<void>;
    calculateFrameToTime(frameNumber: number): number;
    calculateTimeToFrame(time: number): number;
    clearHelpMenuGroups(): Observable<void>;
    clearSafeZones(): Observable<void>;
    detachVideoWindow(): Observable<void>;
    formatToTimecode(time: number): string;
    getActiveAudioTrack(): undefined | OmakaseAudioTrack;
    getAudioTracks(): OmakaseAudioTrack[];
    getCurrentFrame(): number;
    getCurrentTime(): number;
    getCurrentTimecode(): string;
    getDuration(): number;
    getFrameRate(): number;
    getHelpMenuGroups(): HelpMenuGroup[];
    getHls(): undefined | Hls;
    getHTMLVideoElement(): HTMLVideoElement;
    getPlaybackRate(): number;
    getSafeZones(): VideoSafeZone[];
    getTotalFrames(): number;
    getVideo(): undefined | Video;
    getVideoLoadOptions(): undefined | VideoLoadOptions;
    getVideoWindowPlaybackState(): VideoWindowPlaybackState;
    getVolume(): number;
    isAttachVideoWindowEnabled(): boolean;
    isDetachVideoWindowEnabled(): boolean;
    isFullscreen(): boolean;
    isMuted(): boolean;
    isPaused(): boolean;
    isPlaying(): boolean;
    isSeeking(): boolean;
    isVideoLoaded(): boolean;
    loadVideo(sourceUrl: string, frameRate: string | number): Observable<Video>;
    loadVideo(sourceUrl: string, frameRate: string | number, options?: VideoLoadOptions): Observable<Video>;
    mute(): Observable<void>;
    parseTimecodeToFrame(timecode: string): number;
    parseTimecodeToTime(timecode: string): number;
    pause(): Observable<void>;
    play(): Observable<void>;
    prependHelpMenuGroup(helpMenuGroup: HelpMenuGroup): Observable<void>;
    reloadVideo(): Observable<Video>;
    removeSafeZone(id: string): Observable<void>;
    seekFromCurrentFrame(framesCount: number): Observable<boolean>;
    seekFromCurrentTime(timeAmount: number): Observable<boolean>;
    seekNextFrame(): Observable<boolean>;
    seekPreviousFrame(): Observable<boolean>;
    seekToFrame(frame: number): Observable<boolean>;
    seekToPercent(percent: number): Observable<boolean>;
    seekToTime(time: number): Observable<boolean>;
    seekToTimecode(timecode: string): Observable<boolean>;
    setActiveAudioTrack(id: string): Observable<void>;
    setPlaybackRate(playbackRate: number): Observable<void>;
    setVolume(volume: number): Observable<void>;
    toggleFullscreen(): Observable<void>;
    toggleMuteUnmute(): Observable<void>;
    togglePlayPause(): Observable<void>;
    unmute(): Observable<void>;
}

Hierarchy (view full)

Properties

onBuffering$: Observable<VideoBufferingEvent>

Fires on video buffering

onEnded$: Observable<VideoEndedEvent>

Fires on video end

onFullscreenChange$: Observable<VideoFullscreenChangeEvent>

Fires on fullscreen change

onPause$: Observable<VideoPlayEvent>

Fires on video pause

onPlay$: Observable<VideoPlayEvent>

Fires on video play

onPlaybackRateChange$: Observable<VideoPlaybackRateEvent>

Fires on playback rate change

onSeeked$: Observable<VideoSeekedEvent>

Fires on video seeked

onSeeking$: Observable<VideoSeekingEvent>

Fires on video seeking

onVideoError$: Observable<VideoErrorEvent>

Fires on if error occurs on video load

onVideoLoaded$: BehaviorSubject<undefined | VideoLoadedEvent>

Fires on video load. Initial value is undefined.

onVideoLoading$: Observable<VideoLoadingEvent>

Fires on video load start.

onVideoSafeZoneChange$: Observable<VideoSafeZoneChangeEvent>

Fires on video safe zone change

onVideoTimeChange$: Observable<VideoTimeChangeEvent>

Fires on video time change

onVideoWindowPlaybackStateChange$: Observable<VideoWindowPlaybackStateChangeEvent>

Fires on video window playback state change

onVolumeChange$: Observable<VideoVolumeEvent>

Fires on volume change

Methods

  • Adds safe zone area.

    Parameters

    • videoSafeZone: VideoSafeZone

    Returns Observable<VideoSafeZone>

    safe zone id.

  • Parameters

    • frameNumber: number

      Video frame number

    Returns number

    video timestamp in seconds

  • Formats video timestamp to HH:MM:SS:FF

    Parameters

    • time: number

      Video media time in seconds

    Returns string

  • Returns number

    video duration. If duration is provided in loadVideo method, method returns provided value. If duration is not provided in loadVideo method, method returns HTML

  • Converts timestamp in format HH:MM:SS:FF to frame

    Parameters

    • timecode: string

    Returns number

  • Converts timestamp in format HH:MM:SS:FF to time in seconds

    Parameters

    • timecode: string

    Returns number

  • Seeks to video frame offsetted by provided framesCount. Video must be in non-playing mode.

    Parameters

    • framesCount: number

      Positive (seek forward) or negative (seek backward) integer

    Returns Observable<boolean>

  • Seeks to video time offsetted by provided timeAmount. Video must be in non-playing mode.

    Parameters

    • timeAmount: number

      Positive (seek forward) or negative (seek backward) integer

    Returns Observable<boolean>

  • Seeks to particular video frame. Video must be in non-playing mode.

    Parameters

    • frame: number

      Video frame number

    Returns Observable<boolean>

  • Seeks to timeline location

    Parameters

    • percent: number

    Returns Observable<boolean>

  • Seeks to video timestamp

    Parameters

    • time: number

      Video timestamp in seconds

    Returns Observable<boolean>

  • Seeks to video timestamp

    Parameters

    • timecode: string

      Video timestamp in HH:MM:SS:FF format

    Returns Observable<boolean>

  • Sets video playback rate

    Parameters

    • playbackRate: number

      Decimal value between [0.1, 16]. For example, if provided value is "2", video playback rate will be 2x of normal playback rate

    Returns Observable<void>

  • Sets volume level

    Parameters

    • volume: number

      Decimal value between [0, 1]

    Returns Observable<void>