Options
Menu

Class OutputDeviceCollection

A smart collection containing a Set of active output devices.

Hierarchy

  • OutputDeviceCollection

Index

Methods

Methods

delete

  • delete(device: MediaDeviceInfo): boolean
  • Delete a device from the collection. If no devices remain, the 'default' device will be added as the sole device. If no default device exists, the first available device will be used.

    Parameters

    • device: MediaDeviceInfo

      The device to delete from the collection

    Returns boolean

    whether the device was present before it was deleted

get

  • get(): Set<MediaDeviceInfo>

set

  • set(deviceIdOrIds: string | string[]): Promise<void>
  • Replace the current set of devices with a new set of devices.

    Parameters

    • deviceIdOrIds: string | string[]

      An ID or array of IDs of devices to replace the existing devices with.

    Returns Promise<void>

    Rejects if this feature is not supported, any of the supplied IDs are not found, or no IDs are passed.

test

  • test(soundUrl?: string): Promise<any>
  • Test the devices by playing audio through them.

    Parameters

    • Default value soundUrl: string = DEFAULT_TEST_SOUND_URL

    Returns Promise<any>

    Resolves with the result of the underlying HTMLAudioElements' play() calls.

Generated using TypeDoc