The Application class can be used to mute audio globally, and to check if the application (canvas) is currently visible (it's tab is active and not minimized).

Hierarchy

Properties

registerWaitForAllowAudio: ((cb) => void) = Application.registerWaitForInteraction

Type declaration

    • (cb): void
    • Parameters

      Returns void

Deprecated

use Application.registerWaitForInteraction instead

Accessors

  • get hasFocus(): boolean
  • Returns boolean

    true if the document is focused

  • get isVisible(): boolean
  • Returns boolean

    true if the application is currently visible (it's tab is active and not minimized)

  • get muted(): boolean
  • audio muted?

    Returns boolean

  • set muted(value): void
  • set global audio mute

    Parameters

    • value: boolean

    Returns void

  • get userInteractionRegistered(): boolean
  • Returns boolean

Methods

  • Register a callback that will be called when the user interacts with the page (click, touch, keypress, etc).
    If the user has already interacted with the page, the callback will be called immediately.
    This can be used to wait for user interaction before playing audio, for example.

    Parameters

    Returns void

  • Unregister a callback that was previously registered with registerWaitForInteraction.

    Parameters

    Returns void

Generated using TypeDoc