|
@@ -20,7 +20,12 @@ class JitsiMediaDevices extends Listenable {
|
20
|
20
|
constructor() {
|
21
|
21
|
super();
|
22
|
22
|
this._permissions = {};
|
|
23
|
+ }
|
23
|
24
|
|
|
25
|
+ /**
|
|
26
|
+ * Initialize. Start listening for device changes and initialize permissions checks.
|
|
27
|
+ */
|
|
28
|
+ init() {
|
24
|
29
|
RTC.addListener(
|
25
|
30
|
RTCEvents.DEVICE_LIST_CHANGED,
|
26
|
31
|
devices =>
|
|
@@ -89,7 +94,6 @@ class JitsiMediaDevices extends Listenable {
|
89
|
94
|
});
|
90
|
95
|
}
|
91
|
96
|
|
92
|
|
-
|
93
|
97
|
/**
|
94
|
98
|
* Parses a PermissionState object and returns true for granted and false otherwise.
|
95
|
99
|
*
|
|
@@ -130,7 +134,7 @@ class JitsiMediaDevices extends Listenable {
|
130
|
134
|
this.eventEmitter.emit(JitsiMediaDevicesEvents.PERMISSIONS_CHANGED, this._permissions);
|
131
|
135
|
|
132
|
136
|
if (this._permissions[MediaType.AUDIO] || this._permissions[MediaType.VIDEO]) {
|
133
|
|
- // Triggering device list update when the permissiions are granted in order to update
|
|
137
|
+ // Triggering device list update when the permissions are granted in order to update
|
134
|
138
|
// the labels the devices.
|
135
|
139
|
// eslint-disable-next-line no-empty-function
|
136
|
140
|
this.enumerateDevices(() => {});
|