@twilio/voice-sdk
    Preparing search index...

    Class OutputDeviceCollection

    A smart collection containing a Set of active output devices.

    Index

    Methods

    Methods

    • 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 the current set of devices.

      Returns Set<MediaDeviceInfo>

    • 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 the devices by playing audio through them.

      Parameters

      • OptionalsoundUrl: string = DEFAULT_TEST_SOUND_URL

        An optional URL. If none is specified, we will play a default test tone.

      Returns Promise<any>

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