Options
Menu

External module "twilio/shims/mediadevices"

Index

Variables

Const EventTarget

EventTarget: EventTarget = require('./eventtarget')

Const POLL_INTERVAL_MS

POLL_INTERVAL_MS: 500 = 500

Const nativeMediaDevices

nativeMediaDevices: false | MediaDevices = typeof navigator !== 'undefined' && navigator.mediaDevices

Functions

deviceInfosHaveChanged

  • deviceInfosHaveChanged(newDevices: any, oldDevices: any): any

devicesHaveChanged

  • devicesHaveChanged(newDevices: any, oldDevices: any): boolean

hasChangeListeners

  • hasChangeListeners(mediaDevices: any): boolean

Private propertyHasChanged

  • propertyHasChanged(propertyName: string, as: Object[], bs: Object[]): boolean
  • Accepts two sorted arrays and the name of a property to compare on objects from each. Arrays should also be of the same length.

    Parameters

    • propertyName: string

      Name of the property to compare on each object

    • as: Object[]

      The left-side array of objects to compare.

    • bs: Object[]

      The right-side array of objects to compare.

    Returns boolean

    True if the property of any object in array A is different than the same property of its corresponding object in array B.

Private reemitNativeEvent

  • Re-emit the native event, if the native mediaDevices has the corresponding property.

    Parameters

    Returns boolean

    Whether the native mediaDevice had the corresponding property

Private sampleDevices

  • Sample the current set of devices and emit devicechange event if a device has been added or removed, and deviceinfochange if a device's label has changed.

    Parameters

    Returns void

sortDevicesById

  • sortDevicesById(a: any, b: any): boolean

Generated using TypeDoc