Resource type for HTMLVideoElement.

Memberof

PIXI

Hierarchy (view full)

Constructors

Properties

destroyed: boolean

If resource has been destroyed.

Default

false
internal: boolean

true if resource is created by BaseTexture useful for doing cleanup with BaseTexture destroy and not cleaning up resources that were created externally.

source: HTMLVideoElement

Override the source to be the video element.

src: string

The url of the resource

MIME_TYPES: Dict<string>

Map of video MIME types that can't be directly derived from file extensions.

TYPES: string[]

List of common video file extensions supported by VideoResource.

Accessors

  • get autoUpdate(): boolean
  • Should the base texture automatically update itself, set to true by default.

    Returns boolean

  • set autoUpdate(value): void
  • Parameters

    • value: boolean

    Returns void

  • get height(): number
  • The height of the resource.

    Returns number

  • get updateFPS(): number
  • How many times a second to update the texture from the video. If 0, requestVideoFrameCallback is used to update the texture. If requestVideoFrameCallback is not available, the texture is updated every render. A lower fps can help performance, as updating the texture at 60fps on a 30ps video may not be efficient.

    Returns number

  • set updateFPS(value): void
  • Parameters

    • value: number

    Returns void

  • get valid(): boolean
  • Has been validated

    Returns boolean

  • get width(): number
  • The width of the resource.

    Returns number

Methods

  • Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally.

    Returns void

  • Destroys this texture.

    Returns void

  • Start preloading the video resource.

    Returns Promise<VideoResource>

    Handle the validate event

  • Trigger a resize event

    Parameters

    • width: number

      X dimension

    • height: number

      Y dimension

    Returns void

  • Set the style, optional to override

    Parameters

    Returns boolean

    • true is success
  • Trigger updating of the texture.

    Parameters

    • Optional _deltaTime: number

      time delta since last tick

    Returns void

  • Set cross origin based detecting the url and the crossorigin

    Parameters

    • element: HTMLImageElement | HTMLVideoElement

      Element to apply crossOrigin

    • url: string

      URL to check

    • Optional crossorigin: string | boolean

      Cross origin value to use

    Returns void

  • Used to auto-detect the type of resource.

    Parameters

    • source: unknown

      The source object

    • Optional extension: string

      The extension of source, if set

    Returns source is HTMLVideoElement

    true if video source

Generated using TypeDoc