UFVideo encapsulates a single video. It offers a preload method to try to preload the video, so it is ready when needed.

Supports window.UFDEBUG constant to show debug information.

Constructors

  • Constructs an instance of UFVideo.

    Parameters

    • anElement: string | HTMLVideoElement

      Dom id of video element or jquery instance

    • anUrl: string

      Url to mp4 video

    • OptionalaPosterUrl: string

      Url to poster or null if there is none

    • OptionalaShowOnPlay: boolean

      True=show element when play is called, false=show element when video is ready to play

    • OptionalaPlayingCallback: UFCallback

      Callback to call when video started playing

    • OptionalaStoppedCallback: UFCallback

      Callback to call when video stopped playing

    Returns UFVideo

Accessors

Methods

  • Handles video being available to play.

    Parameters

    • anEvent: Event

    Returns void

  • Plays and shows the video from the start.

    Parameters

    • aLoop: boolean

      True=loop the video (aDoneCallback is ignored)

    • OptionalaStartCallback: UFCallback

      To call when video has started playing

    • OptionalaDoneCallback: UFCallback

      To call when video has finished playing

    Returns void