Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Html5AudioStatic

The static class that handles HTML5 Audio.

class

Html5Audio

constructor

Hierarchy

  • Html5AudioStatic

Index

Properties

_audioElement

_audioElement: HTMLAudioElement

_autoPlay

_autoPlay: boolean

_buffered

_buffered: boolean

_gainTweenInterval

_gainTweenInterval: number

_hasError

_hasError: boolean

_initialized

_initialized: boolean

_isLoading

_isLoading: boolean

_loadListeners

_loadListeners: Array<function>

_staticSePath

_staticSePath: boolean

_tweenGain

_tweenGain: number

_tweenGainStep

_tweenGainStep: number

_tweenTargetGain

_tweenTargetGain: number

_unlocked

_unlocked: boolean

_volume

_volume: number

url

url: string

[read-only] The url of the audio file.

property

url

type

String

volume

volume: number

The volume of the audio.

property

volume

type

Number

Methods

Private _applyTweenValue

  • _applyTweenValue(volume: number): void

Private _load

  • _load(url: string): void

Private _onEnded

  • _onEnded(): void

Private _onError

  • _onError(): void

Private _onHide

  • _onHide(): void

Private _onLoad

  • _onLoad(): void

Private _onLoadedData

  • _onLoadedData(): void

Private _onShow

  • _onShow(): void

Private _onTouchStart

  • _onTouchStart(): void

Private _onVisibilityChange

  • _onVisibilityChange(): void

Private _setupEventHandlers

  • _setupEventHandlers(): void

Private _startGainTweenfunction

  • _startGainTweenfunction(duration: number): void

Private _startPlaying

  • _startPlaying(loop: boolean, offset: number): void

addLoadListener

  • addLoadListener(listner: function): void
  • Add a callback function that will be called when the audio data is loaded.

    static
    method

    addLoadListener

    Parameters

    • listner: function

      The callback function

        • (): void
        • Returns void

    Returns void

clear

  • clear(): void

fadeIn

  • fadeIn(duration: number): void

fadeOut

  • fadeOut(duration: number): void

initialize

  • initialize(): void

isError

  • isError(): boolean
  • Checks whether a loading error has occurred.

    static
    method

    isError

    Returns boolean

    True if a loading error has occurred

isPlaying

  • isPlaying(): boolean

isReady

  • isReady(): boolean
  • Checks whether the audio data is ready to play.

    static
    method

    isReady

    Returns boolean

    True if the audio data is ready to play

play

  • play(loop: boolean, offset: number): void
  • Plays the audio.

    static
    method

    play

    Parameters

    • loop: boolean

      Whether the audio data play in a loop

    • offset: number

      The start position to play in seconds

    Returns void

seek

  • seek(): void

setStaticSe

  • setStaticSe(url: string): void

setup

  • setup(url: string): void

stop

  • stop(): void

Generated using TypeDoc