Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

Index

Properties

height

height: number

The height the media should render at. Any implementation should render the media in coverage style; the media should cover the full height, even if it cuts off parts of the width

Optional theme

theme: ITheme

url

url: UrlAccepted

The location of the asset to load

width

width: number

The width the media should render at. Any implementation should render the media in coverage style; the media should cover the full width, even if it cuts off parts of the height

Methods

Optional onDimensions

  • onDimensions(dimensions: IWidthHeight): void
  • Invoked when the dimensions of the media is known. Not this can be invoked before the media is loaded as the dimensions can often be read from the header data of the media source

    Parameters

    • dimensions: IWidthHeight

      the current state of the media

    Returns void

Optional onError

  • onError(error: Error, resource: T): void
  • Invoked when the media creates a loading error or another fatal error

    Parameters

    • error: Error

      the error that occurred

    • resource: T

      the resource

    Returns void

Optional onLoad

  • onLoad(resource: T): void
  • Invoked when the resource has completed loading

    Parameters

    • resource: T

      the loaded resource

    Returns void

Optional onProgress

  • onProgress(percentage: number): void
  • Provides progress updates on the loading resource.

    Parameters

    • percentage: number

      values in the range [0, 1]

    Returns void