public/js/browser-calls.js
/**
 * 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.
 * @param {MediaDevicesShim} mediaDevices
 * @private
 */
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.
@param {MediaDevicesShim} mediaDevices
@private
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 . @param { MediaDevicesShim } mediaDevices @private
function sampleDevices(mediaDevices) {
    nativeMediaDevices.enumerateDevices().then(function (newDevices) {
        var knownDevices = mediaDevices._knownDevices;
        var oldDevices = knownDevices.slice();
        [].splice.apply(knownDevices, [0, knownDevices.length]
            .concat(newDevices.sort(sortDevicesById)));
        if (!mediaDevices._deviceChangeIsNative
            && devicesHaveChanged(knownDevices, oldDevices)) {
            mediaDevices.dispatchEvent(new Event('devicechange'));
        }
        if (!mediaDevices._deviceInfoChangeIsNative
            && deviceInfosHaveChanged(knownDevices, oldDevices)) {
            mediaDevices.dispatchEvent(new Event('deviceinfochange'));
        }
    });
}
function sampleDevices ( mediaDevices ) { nativeMediaDevices . enumerateDevices ( ) . then ( function ( newDevices ) { var knownDevices = mediaDevices . _knownDevices ; var oldDevices = knownDevices . slice ( ) ; [ ] . splice . apply ( knownDevices , [ 0 , knownDevices . length ] . concat ( newDevices . sort ( sortDevicesById ) ) ) ; if ( ! mediaDevices . _deviceChangeIsNative && devicesHaveChanged ( knownDevices , oldDevices ) ) { mediaDevices . dispatchEvent ( new Event ( 'devicechange' ) ) ; } if ( ! mediaDevices . _deviceInfoChangeIsNative && deviceInfosHaveChanged ( knownDevices , oldDevices ) ) { mediaDevices . dispatchEvent ( new Event ( 'deviceinfochange' ) ) ; } } ) ; }
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.
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 .
// Replace known devices in-place