@seniorsistemas/angular-components 17.26.9-bugfix-sds-309-cfd66723 → 17.26.9-bugfix-sds-309-1338ba18
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/bundles/seniorsistemas-angular-components.umd.js +43 -38
- package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
- package/bundles/seniorsistemas-angular-components.umd.min.js +2 -2
- package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
- package/components/speech-recognition/speech-recognition.service.d.ts +1 -1
- package/esm2015/components/speech-recognition/speech-recognition.service.js +26 -25
- package/esm5/components/speech-recognition/speech-recognition.service.js +44 -39
- package/fesm2015/seniorsistemas-angular-components.js +25 -24
- package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
- package/fesm5/seniorsistemas-angular-components.js +43 -38
- package/fesm5/seniorsistemas-angular-components.js.map +1 -1
- package/package.json +1 -1
- package/seniorsistemas-angular-components.metadata.json +1 -1
|
@@ -11368,7 +11368,7 @@ var SpeechRecognitionService = /** @class */ (function () {
|
|
|
11368
11368
|
if (this.isListening) {
|
|
11369
11369
|
speechSubject.error('Already listening');
|
|
11370
11370
|
}
|
|
11371
|
-
this.hasMicrophoneAccess
|
|
11371
|
+
this.hasMicrophoneAccess.then(function (hasAccess) {
|
|
11372
11372
|
if (!hasAccess) {
|
|
11373
11373
|
_this.toastService.show({ severity: 'error', text: _this.translateService.instant('platform.angular_components.no_microphone_permission') });
|
|
11374
11374
|
speechSubject.error('Microphone access is disabled');
|
|
@@ -11447,43 +11447,48 @@ var SpeechRecognitionService = /** @class */ (function () {
|
|
|
11447
11447
|
this.recognition.maxAlternatives = 1;
|
|
11448
11448
|
this.localeService.getLocale().subscribe(function (locale) { return _this.recognition.lang = locale; });
|
|
11449
11449
|
};
|
|
11450
|
-
SpeechRecognitionService.prototype
|
|
11451
|
-
|
|
11452
|
-
var
|
|
11453
|
-
return
|
|
11454
|
-
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11483
|
-
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11450
|
+
Object.defineProperty(SpeechRecognitionService.prototype, "hasMicrophoneAccess", {
|
|
11451
|
+
get: function () {
|
|
11452
|
+
var _this = this;
|
|
11453
|
+
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
11454
|
+
var permission;
|
|
11455
|
+
var _this = this;
|
|
11456
|
+
return __generator(this, function (_a) {
|
|
11457
|
+
switch (_a.label) {
|
|
11458
|
+
case 0: return [4 /*yield*/, navigator.permissions.query({ name: 'microphone' })];
|
|
11459
|
+
case 1:
|
|
11460
|
+
permission = _a.sent();
|
|
11461
|
+
if (permission.state === 'denied') {
|
|
11462
|
+
resolve(false);
|
|
11463
|
+
}
|
|
11464
|
+
else if (permission.state === 'granted') {
|
|
11465
|
+
resolve(true);
|
|
11466
|
+
}
|
|
11467
|
+
else if (permission.state === 'prompt') {
|
|
11468
|
+
try {
|
|
11469
|
+
navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) {
|
|
11470
|
+
stream.getTracks().forEach(function (t) { return t.stop(); });
|
|
11471
|
+
}).catch(function () {
|
|
11472
|
+
resolve(false);
|
|
11473
|
+
});
|
|
11474
|
+
permission.onchange = function () {
|
|
11475
|
+
_this.ngZone.run(function () {
|
|
11476
|
+
resolve(permission.state === 'granted' ? true : false);
|
|
11477
|
+
});
|
|
11478
|
+
};
|
|
11479
|
+
}
|
|
11480
|
+
catch (error) {
|
|
11481
|
+
resolve(false);
|
|
11482
|
+
}
|
|
11483
|
+
}
|
|
11484
|
+
return [2 /*return*/];
|
|
11485
|
+
}
|
|
11486
|
+
});
|
|
11487
|
+
}); });
|
|
11488
|
+
},
|
|
11489
|
+
enumerable: true,
|
|
11490
|
+
configurable: true
|
|
11491
|
+
});
|
|
11487
11492
|
SpeechRecognitionService.ctorParameters = function () { return [
|
|
11488
11493
|
{ type: LocaleService },
|
|
11489
11494
|
{ type: NgZone },
|