|
|
@@ -2,10 +2,6 @@
|
|
2
|
2
|
|
|
3
|
3
|
import { getAudioOutputDeviceId } from '../../react/features/base/devices';
|
|
4
|
4
|
|
|
5
|
|
-let currentAudioInputDevices,
|
|
6
|
|
- currentAudioOutputDevices,
|
|
7
|
|
- currentVideoInputDevices;
|
|
8
|
|
-
|
|
9
|
5
|
/**
|
|
10
|
6
|
* Determines if currently selected audio output device should be changed after
|
|
11
|
7
|
* list of available devices has been changed.
|
|
|
@@ -105,47 +101,6 @@ function getNewVideoInputDevice(newDevices, localVideo) {
|
|
105
|
101
|
}
|
|
106
|
102
|
|
|
107
|
103
|
export default {
|
|
108
|
|
- /**
|
|
109
|
|
- * Returns list of devices of single kind.
|
|
110
|
|
- * @param {MediaDeviceInfo[]} devices
|
|
111
|
|
- * @param {'audioinput'|'audiooutput'|'videoinput'} kind
|
|
112
|
|
- * @returns {MediaDeviceInfo[]}
|
|
113
|
|
- */
|
|
114
|
|
- getDevicesFromListByKind(devices, kind) {
|
|
115
|
|
- return devices.filter(d => d.kind === kind);
|
|
116
|
|
- },
|
|
117
|
|
-
|
|
118
|
|
- /**
|
|
119
|
|
- * Stores lists of current 'audioinput', 'videoinput' and 'audiooutput'
|
|
120
|
|
- * devices.
|
|
121
|
|
- * @param {MediaDeviceInfo[]} devices
|
|
122
|
|
- */
|
|
123
|
|
- setCurrentMediaDevices(devices) {
|
|
124
|
|
- currentAudioInputDevices
|
|
125
|
|
- = this.getDevicesFromListByKind(devices, 'audioinput');
|
|
126
|
|
- currentVideoInputDevices
|
|
127
|
|
- = this.getDevicesFromListByKind(devices, 'videoinput');
|
|
128
|
|
- currentAudioOutputDevices
|
|
129
|
|
- = this.getDevicesFromListByKind(devices, 'audiooutput');
|
|
130
|
|
- },
|
|
131
|
|
-
|
|
132
|
|
- /**
|
|
133
|
|
- * Returns lists of current 'audioinput', 'videoinput' and 'audiooutput'
|
|
134
|
|
- * devices.
|
|
135
|
|
- * @returns {{
|
|
136
|
|
- * audioinput: (MediaDeviceInfo[]|undefined),
|
|
137
|
|
- * videoinput: (MediaDeviceInfo[]|undefined),
|
|
138
|
|
- * audiooutput: (MediaDeviceInfo[]|undefined),
|
|
139
|
|
- * }}
|
|
140
|
|
- */
|
|
141
|
|
- getCurrentMediaDevices() {
|
|
142
|
|
- return {
|
|
143
|
|
- audioinput: currentAudioInputDevices,
|
|
144
|
|
- videoinput: currentVideoInputDevices,
|
|
145
|
|
- audiooutput: currentAudioOutputDevices
|
|
146
|
|
- };
|
|
147
|
|
- },
|
|
148
|
|
-
|
|
149
|
104
|
/**
|
|
150
|
105
|
* Determines if currently selected media devices should be changed after
|
|
151
|
106
|
* list of available devices has been changed.
|