Options
All
  • Public
  • Public/Protected
  • All
Menu

MediaPool

A Pool which handles time-based media. See VideoPool and AudioPool.

Hierarchy

Index

Constructors

constructor

  • new MediaPool(__namedParameters: object): MediaPool
  • Parameters

    • __namedParameters: object
      • assets: Asset[]

        A list of Assets handled by this Pool.

      • dropCount: number | function
      • dropDistributionWeight: number | function
      • duration: number | function
      • loop: boolean
      • ordered: boolean

        Whether to consume the assets in the provided order (default: false).

    Returns MediaPool

Properties

assets

assets: Asset[]

List of media sources used by this Pool.

destroy$

destroy$: Observable<void>

Fires when the Pool stops and is not looping.

drop$

drop$: Observable<number>

Fires for each drop in the Pool. Callback is passed the drop index.

dropCount

dropCount: number

The number of times the present run will drop.

dropDistributionWeight

dropDistributionWeight: number = 1

The distribution weighting for drops in the Pool * (1 = neutral, lower = later, higher = earlier). Uses weightedRandom under the hood.

NB: This will be changed to use a distribution function in future versions.

duration

duration: number

Total duration of the current iteration of the pool (ms).

loop

loop: boolean = false

Whether the Pool should restart when it ends.

ordered

ordered: boolean = false

Determines whether the Assets will be played in order or at random. (To weight the randomness, add duplicate Assets.)

pause$

pause$: Observable<void>

Fires when the Pool is paused.

play$

play$: Observable<HowlReference | Video>

Fires when media starts to play.

queue

queue: any[]

Queued sources or media.

resume$

resume$: Observable<void>

Fires when the Pool is resumed.

start$

start$: Observable<void>

Fires at the start of a Pool cycle.

stop$

stop$: Observable<void>

Fires at the end of a Pool cycle.

Methods

pause

  • pause(): void
  • Pauses the Pool.

    Returns void

Abstract preloadAll

  • preloadAll(): Observable<void>
  • Preloads all of the assets provided to the Pool.

    Returns Observable<void>

    An Observable which fires when all the sources have preloaded. The point at which the source is deemed to have been preloaded is determined by the subclass.

resume

  • resume(): void
  • Resumes the Pool.

    Returns void

start

  • start(): void
  • Starts the pool.

    Returns void

stop

  • stop(): void
  • 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