Options
All
  • Public
  • Public/Protected
  • All
Menu

Video

A wrapper around the HTMLVideoElement providing useful shorthands.

Hierarchy

  • Video

Index

Constructors

constructor

  • Parameters

    • asset: Asset

      The Asset representing this video. The asset's sources and formats are used in order.

    Returns Video

Properties

canplaythrough

canplaythrough: boolean = false

Whether the element's canplaythrough event has fired.

el

el: HTMLVideoElement

The HTMLVideoElement.

Optional rate

rate: number | function

The playback rate (multiplier). See Asset.rate.

Optional seek

seek: number | function

The media's seek point (sec). See [[Asset.seek].

src

src: string

The HTMLVideoElement's currentSrc.

Methods

after

  • after(duration: number, cb: function): void
  • Fire the callback once after playing for the duration (sec), or, if the provided duration is negative, that many seconds from the video end. Removes need for complicated timeout management.

    Parameters

    • duration: number
    • cb: function
        • (...any: any[]): void
        • Parameters

          • Rest ...any: any[]

          Returns void

    Returns void

destroy

  • destroy(): void
  • Pauses the video, removes all handlers, and removes element from DOM.

    Returns void

off

  • off(event: string, callback: function): void
  • Removes an event listener added in on or once.

    Parameters

    • event: string
    • callback: function
        • (...any: any[]): any
        • Parameters

          • Rest ...any: any[]

          Returns any

    Returns void

on

  • on(event: string, cb: function): void
  • Adds an event listener with addEventListener. Remove with off.

    Parameters

    • event: string
    • cb: function
        • (...any: any[]): void
        • Parameters

          • Rest ...any: any[]

          Returns void

    Returns void

once

  • once(event: string, cb: function): void
  • Adds an event listener with on which is removed after the event fires.

    Parameters

    • event: string
    • cb: function
        • (...any: any[]): void
        • Parameters

          • Rest ...any: any[]

          Returns void

    Returns void

pause

  • pause(): void
  • Pause the video playback.

    Returns void

play

  • play(): void
  • Start the video playback

    Returns void

playWhenReady

  • playWhenReady(): void
  • Start the video playback after canplaythrough has fired.

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc