podchat-browser 12.9.14 → 12.9.15-snapshot.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +1 -1
- package/dist/node/buildConfig.json +1 -1
- package/dist/node/lib/call/deviceManager.js +66 -55
- package/dist/node/lib/logManager.js +41 -0
- package/dist/podchat-browser-bundle.js +67 -55
- package/package.json +1 -1
- package/src/buildConfig.json +1 -1
- package/src/lib/call/deviceManager.js +20 -13
package/changelog.md
CHANGED
|
@@ -5,7 +5,7 @@ to see complete list of changelog please visit [ChangeLog](http://gp.fanapsoft.i
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
-
## [12.9.14]
|
|
8
|
+
## [12.9.14] 10-09-2024
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
- Possibility to remember last chosen media device on changeMediaDevice functionality in calls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"12.9.
|
|
1
|
+
{"version":"12.9.15-snapshot.0","date":"۱۴۰۳/۶/۲۵","VersionInfo":"Release: false, Snapshot: true, Is For Test: true"}
|
|
@@ -201,63 +201,74 @@ function DeviceManager(app) {
|
|
|
201
201
|
});
|
|
202
202
|
} else {
|
|
203
203
|
// List cameras and microphones.
|
|
204
|
-
deviceManager.grantUserMediaDevicesPermissions({
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
},
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
// deviceManager.mediaStreams.stopVideoInput();
|
|
240
|
-
deviceManager.mediaStreams.stopAudioInput();
|
|
241
|
-
// const filteredDevices = deviceManager.removeDuplicateGroupIds(my_devices);
|
|
242
|
-
callback && callback({
|
|
243
|
-
hasError: false,
|
|
244
|
-
devices: my_devices
|
|
245
|
-
});
|
|
246
|
-
// resolve(my_devices);
|
|
247
|
-
})["catch"](function (err) {
|
|
248
|
-
callback && callback({
|
|
249
|
-
hasError: false,
|
|
250
|
-
message: err.message,
|
|
251
|
-
devices: []
|
|
204
|
+
// deviceManager.grantUserMediaDevicesPermissions({
|
|
205
|
+
// // audio: true,
|
|
206
|
+
// // video: false,
|
|
207
|
+
// // }, (result) => {
|
|
208
|
+
navigator.mediaDevices.getUserMedia({
|
|
209
|
+
audio: true
|
|
210
|
+
}).then(function (stream) {
|
|
211
|
+
// if(!result.hasError){
|
|
212
|
+
// app.call.currentCall().deviceManager().mediaStreams.stopAudioInput();
|
|
213
|
+
// navigator.mediaDevices.getUserMedia({audio:true, video:false}).then(tempStream => {
|
|
214
|
+
navigator.mediaDevices.enumerateDevices().then(function (devices) {
|
|
215
|
+
var my_devices = {
|
|
216
|
+
audioinput: [],
|
|
217
|
+
videoinput: [],
|
|
218
|
+
audiooutput: []
|
|
219
|
+
};
|
|
220
|
+
devices.forEach(function (device) {
|
|
221
|
+
var _my_devices$kind;
|
|
222
|
+
var kind = device.kind,
|
|
223
|
+
label = device.label,
|
|
224
|
+
deviceId = device.deviceId,
|
|
225
|
+
groupId = device.groupId;
|
|
226
|
+
var active;
|
|
227
|
+
if (kind == 'videoinput') {
|
|
228
|
+
active = deviceId == app.preferredMediaDevices.get('videoIn');
|
|
229
|
+
} else if (kind == 'audioinput') {
|
|
230
|
+
active = deviceId == app.preferredMediaDevices.get('audioIn');
|
|
231
|
+
} else if (kind == 'audiooutput') {
|
|
232
|
+
active = deviceId == app.preferredMediaDevices.get('audioOut');
|
|
233
|
+
}
|
|
234
|
+
(_my_devices$kind = my_devices[kind]) === null || _my_devices$kind === void 0 ? void 0 : _my_devices$kind.push({
|
|
235
|
+
label: label,
|
|
236
|
+
deviceId: deviceId,
|
|
237
|
+
groupId: groupId,
|
|
238
|
+
active: active
|
|
252
239
|
});
|
|
253
|
-
// reject(err)
|
|
254
|
-
console.error("".concat(err.name, ": ").concat(err.message));
|
|
255
240
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
241
|
+
stream.getTracks().forEach(function (item) {
|
|
242
|
+
return item.stop();
|
|
243
|
+
});
|
|
244
|
+
// deviceManager.mediaStreams.stopAudioInput();
|
|
245
|
+
callback && callback({
|
|
246
|
+
hasError: false,
|
|
247
|
+
devices: my_devices
|
|
248
|
+
});
|
|
249
|
+
})["catch"](function (err) {
|
|
250
|
+
callback && callback({
|
|
251
|
+
hasError: false,
|
|
252
|
+
message: err.message,
|
|
253
|
+
devices: []
|
|
254
|
+
});
|
|
255
|
+
// reject(err)
|
|
256
|
+
console.error("".concat(err.name, ": ").concat(err.message));
|
|
257
|
+
});
|
|
258
|
+
// resolve(result);
|
|
259
|
+
// callback && callback(result);
|
|
260
|
+
|
|
261
|
+
// } else {
|
|
262
|
+
// callback && callback(result);
|
|
263
|
+
// }
|
|
264
|
+
})["catch"](function (err) {
|
|
265
|
+
callback && callback({
|
|
266
|
+
hasError: false,
|
|
267
|
+
message: err.message,
|
|
268
|
+
devices: []
|
|
269
|
+
});
|
|
270
|
+
// reject(err)
|
|
271
|
+
console.error("".concat(err.name, ": ").concat(err.message));
|
|
261
272
|
});
|
|
262
273
|
|
|
263
274
|
// });
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
function LogsManager(app) {
|
|
8
|
+
var tags = {};
|
|
9
|
+
return {
|
|
10
|
+
registerTag: function registerTag(tag) {
|
|
11
|
+
tags[tag.id] = {
|
|
12
|
+
enabled: tag.enabled,
|
|
13
|
+
label: tag.label,
|
|
14
|
+
labelColor: tag.labelColor || 'blue'
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
enableTag: function enableTag(id) {
|
|
18
|
+
tags[id].enabled = true;
|
|
19
|
+
},
|
|
20
|
+
disableTag: function disableTag(id) {
|
|
21
|
+
tags[id].enabled = false;
|
|
22
|
+
},
|
|
23
|
+
log: function log(tagId, label, string) {
|
|
24
|
+
if (tags[tagId] && tags[tagId].enabled) {
|
|
25
|
+
console.log("%c[SDK]".concat(tags[tagId].label).concat(label, " "), "color: ".concat(tags[tagId].labelColor, ";"), string);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
error: function error(tagId, label, string) {
|
|
29
|
+
if (tags[tagId] && tags[tagId].enabled) {
|
|
30
|
+
console.error("%c[SDK]".concat(tags[tagId].label).concat(label, " "), "color: ".concat(tags[tagId].labelColor, ";"), string);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
warn: function warn(tagId, label, string) {
|
|
34
|
+
if (tags[tagId] && tags[tagId].enabled) {
|
|
35
|
+
console.warn("%c[SDK]".concat(tags[tagId].label).concat(label, " "), "color: ".concat(tags[tagId].labelColor, ";"), string);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var _default = LogsManager;
|
|
41
|
+
exports["default"] = _default;
|
|
@@ -45388,7 +45388,7 @@ FilterXSS.prototype.process = function (html) {
|
|
|
45388
45388
|
module.exports = FilterXSS;
|
|
45389
45389
|
|
|
45390
45390
|
},{"./default":277,"./parser":279,"./util":280,"cssfilter":128}],282:[function(require,module,exports){
|
|
45391
|
-
module.exports={"version":"12.9.
|
|
45391
|
+
module.exports={"version":"12.9.15-snapshot.0","date":"۱۴۰۳/۶/۲۵","VersionInfo":"Release: false, Snapshot: true, Is For Test: true"}
|
|
45392
45392
|
},{}],283:[function(require,module,exports){
|
|
45393
45393
|
"use strict";
|
|
45394
45394
|
|
|
@@ -53811,63 +53811,75 @@ function DeviceManager(app) {
|
|
|
53811
53811
|
});
|
|
53812
53812
|
} else {
|
|
53813
53813
|
// List cameras and microphones.
|
|
53814
|
-
deviceManager.grantUserMediaDevicesPermissions({
|
|
53815
|
-
|
|
53816
|
-
|
|
53817
|
-
},
|
|
53818
|
-
|
|
53819
|
-
|
|
53820
|
-
|
|
53821
|
-
|
|
53822
|
-
|
|
53823
|
-
|
|
53824
|
-
|
|
53825
|
-
|
|
53826
|
-
|
|
53827
|
-
|
|
53828
|
-
|
|
53829
|
-
|
|
53830
|
-
|
|
53831
|
-
|
|
53832
|
-
|
|
53833
|
-
|
|
53834
|
-
|
|
53835
|
-
|
|
53836
|
-
|
|
53837
|
-
|
|
53838
|
-
|
|
53839
|
-
|
|
53840
|
-
|
|
53841
|
-
|
|
53842
|
-
|
|
53814
|
+
// deviceManager.grantUserMediaDevicesPermissions({
|
|
53815
|
+
// // audio: true,
|
|
53816
|
+
// // video: false,
|
|
53817
|
+
// // }, (result) => {
|
|
53818
|
+
navigator.mediaDevices.getUserMedia({
|
|
53819
|
+
audio: true
|
|
53820
|
+
}).then(function (stream) {
|
|
53821
|
+
// if(!result.hasError){
|
|
53822
|
+
// app.call.currentCall().deviceManager().mediaStreams.stopAudioInput();
|
|
53823
|
+
// navigator.mediaDevices.getUserMedia({audio:true, video:false}).then(tempStream => {
|
|
53824
|
+
navigator.mediaDevices.enumerateDevices().then(function (devices) {
|
|
53825
|
+
var my_devices = {
|
|
53826
|
+
audioinput: [],
|
|
53827
|
+
videoinput: [],
|
|
53828
|
+
audiooutput: []
|
|
53829
|
+
};
|
|
53830
|
+
devices.forEach(function (device) {
|
|
53831
|
+
var _my_devices$kind;
|
|
53832
|
+
|
|
53833
|
+
var kind = device.kind,
|
|
53834
|
+
label = device.label,
|
|
53835
|
+
deviceId = device.deviceId,
|
|
53836
|
+
groupId = device.groupId;
|
|
53837
|
+
var active;
|
|
53838
|
+
|
|
53839
|
+
if (kind == 'videoinput') {
|
|
53840
|
+
active = deviceId == app.preferredMediaDevices.get('videoIn');
|
|
53841
|
+
} else if (kind == 'audioinput') {
|
|
53842
|
+
active = deviceId == app.preferredMediaDevices.get('audioIn');
|
|
53843
|
+
} else if (kind == 'audiooutput') {
|
|
53844
|
+
active = deviceId == app.preferredMediaDevices.get('audioOut');
|
|
53845
|
+
}
|
|
53843
53846
|
|
|
53844
|
-
|
|
53845
|
-
|
|
53846
|
-
|
|
53847
|
-
|
|
53848
|
-
|
|
53849
|
-
|
|
53850
|
-
|
|
53847
|
+
(_my_devices$kind = my_devices[kind]) === null || _my_devices$kind === void 0 ? void 0 : _my_devices$kind.push({
|
|
53848
|
+
label: label,
|
|
53849
|
+
deviceId: deviceId,
|
|
53850
|
+
groupId: groupId,
|
|
53851
|
+
active: active
|
|
53852
|
+
});
|
|
53853
|
+
});
|
|
53854
|
+
stream.getTracks().forEach(function (item) {
|
|
53855
|
+
return item.stop();
|
|
53856
|
+
}); // deviceManager.mediaStreams.stopAudioInput();
|
|
53851
53857
|
|
|
53852
|
-
|
|
53858
|
+
callback && callback({
|
|
53859
|
+
hasError: false,
|
|
53860
|
+
devices: my_devices
|
|
53861
|
+
});
|
|
53862
|
+
})["catch"](function (err) {
|
|
53863
|
+
callback && callback({
|
|
53864
|
+
hasError: false,
|
|
53865
|
+
message: err.message,
|
|
53866
|
+
devices: []
|
|
53867
|
+
}); // reject(err)
|
|
53868
|
+
|
|
53869
|
+
console.error("".concat(err.name, ": ").concat(err.message));
|
|
53870
|
+
}); // resolve(result);
|
|
53871
|
+
// callback && callback(result);
|
|
53872
|
+
// } else {
|
|
53873
|
+
// callback && callback(result);
|
|
53874
|
+
// }
|
|
53875
|
+
})["catch"](function (err) {
|
|
53876
|
+
callback && callback({
|
|
53877
|
+
hasError: false,
|
|
53878
|
+
message: err.message,
|
|
53879
|
+
devices: []
|
|
53880
|
+
}); // reject(err)
|
|
53853
53881
|
|
|
53854
|
-
|
|
53855
|
-
hasError: false,
|
|
53856
|
-
devices: my_devices
|
|
53857
|
-
}); // resolve(my_devices);
|
|
53858
|
-
})["catch"](function (err) {
|
|
53859
|
-
callback && callback({
|
|
53860
|
-
hasError: false,
|
|
53861
|
-
message: err.message,
|
|
53862
|
-
devices: []
|
|
53863
|
-
}); // reject(err)
|
|
53864
|
-
|
|
53865
|
-
console.error("".concat(err.name, ": ").concat(err.message));
|
|
53866
|
-
}); // resolve(result);
|
|
53867
|
-
// callback && callback(result);
|
|
53868
|
-
} else {
|
|
53869
|
-
callback && callback(result);
|
|
53870
|
-
}
|
|
53882
|
+
console.error("".concat(err.name, ": ").concat(err.message));
|
|
53871
53883
|
}); // });
|
|
53872
53884
|
|
|
53873
53885
|
if (!navigator.mediaDevices.ondevicechange) {
|
package/package.json
CHANGED
package/src/buildConfig.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"12.9.
|
|
1
|
+
{"version":"12.9.15-snapshot.0","date":"۱۴۰۳/۶/۲۵","VersionInfo":"Release: false, Snapshot: true, Is For Test: true"}
|
|
@@ -145,11 +145,14 @@ function DeviceManager(app) {
|
|
|
145
145
|
callback && callback({hasError: true});
|
|
146
146
|
} else {
|
|
147
147
|
// List cameras and microphones.
|
|
148
|
-
deviceManager.grantUserMediaDevicesPermissions({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, (result) => {
|
|
152
|
-
|
|
148
|
+
// deviceManager.grantUserMediaDevicesPermissions({
|
|
149
|
+
// // audio: true,
|
|
150
|
+
// // video: false,
|
|
151
|
+
// // }, (result) => {
|
|
152
|
+
navigator.mediaDevices.getUserMedia({audio: true}).then(stream => {
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
// if(!result.hasError){
|
|
153
156
|
// app.call.currentCall().deviceManager().mediaStreams.stopAudioInput();
|
|
154
157
|
// navigator.mediaDevices.getUserMedia({audio:true, video:false}).then(tempStream => {
|
|
155
158
|
navigator.mediaDevices
|
|
@@ -169,11 +172,9 @@ function DeviceManager(app) {
|
|
|
169
172
|
my_devices[kind]?.push({label, deviceId, groupId, active});
|
|
170
173
|
});
|
|
171
174
|
|
|
172
|
-
|
|
173
|
-
deviceManager.mediaStreams.stopAudioInput();
|
|
174
|
-
// const filteredDevices = deviceManager.removeDuplicateGroupIds(my_devices);
|
|
175
|
+
stream.getTracks().forEach(item => item.stop());
|
|
176
|
+
// deviceManager.mediaStreams.stopAudioInput();
|
|
175
177
|
callback && callback({hasError: false, devices: my_devices})
|
|
176
|
-
// resolve(my_devices);
|
|
177
178
|
})
|
|
178
179
|
.catch((err) => {
|
|
179
180
|
callback && callback({hasError: false, message: err.message, devices: []})
|
|
@@ -182,10 +183,16 @@ function DeviceManager(app) {
|
|
|
182
183
|
});
|
|
183
184
|
// resolve(result);
|
|
184
185
|
// callback && callback(result);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
// } else {
|
|
189
|
+
// callback && callback(result);
|
|
190
|
+
// }
|
|
191
|
+
}).catch((err) => {
|
|
192
|
+
callback && callback({hasError: false, message: err.message, devices: []})
|
|
193
|
+
// reject(err)
|
|
194
|
+
console.error(`${err.name}: ${err.message}`);
|
|
195
|
+
});
|
|
189
196
|
|
|
190
197
|
|
|
191
198
|
// });
|