@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
|
@@ -11513,7 +11513,7 @@
|
|
|
11513
11513
|
if (this.isListening) {
|
|
11514
11514
|
speechSubject.error('Already listening');
|
|
11515
11515
|
}
|
|
11516
|
-
this.hasMicrophoneAccess
|
|
11516
|
+
this.hasMicrophoneAccess.then(function (hasAccess) {
|
|
11517
11517
|
if (!hasAccess) {
|
|
11518
11518
|
_this.toastService.show({ severity: 'error', text: _this.translateService.instant('platform.angular_components.no_microphone_permission') });
|
|
11519
11519
|
speechSubject.error('Microphone access is disabled');
|
|
@@ -11592,43 +11592,48 @@
|
|
|
11592
11592
|
this.recognition.maxAlternatives = 1;
|
|
11593
11593
|
this.localeService.getLocale().subscribe(function (locale) { return _this.recognition.lang = locale; });
|
|
11594
11594
|
};
|
|
11595
|
-
SpeechRecognitionService.prototype
|
|
11596
|
-
|
|
11597
|
-
var
|
|
11598
|
-
return
|
|
11599
|
-
|
|
11600
|
-
|
|
11601
|
-
|
|
11602
|
-
|
|
11603
|
-
|
|
11604
|
-
|
|
11605
|
-
|
|
11606
|
-
|
|
11607
|
-
|
|
11608
|
-
|
|
11609
|
-
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11631
|
-
|
|
11595
|
+
Object.defineProperty(SpeechRecognitionService.prototype, "hasMicrophoneAccess", {
|
|
11596
|
+
get: function () {
|
|
11597
|
+
var _this = this;
|
|
11598
|
+
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
11599
|
+
var permission;
|
|
11600
|
+
var _this = this;
|
|
11601
|
+
return __generator(this, function (_a) {
|
|
11602
|
+
switch (_a.label) {
|
|
11603
|
+
case 0: return [4 /*yield*/, navigator.permissions.query({ name: 'microphone' })];
|
|
11604
|
+
case 1:
|
|
11605
|
+
permission = _a.sent();
|
|
11606
|
+
if (permission.state === 'denied') {
|
|
11607
|
+
resolve(false);
|
|
11608
|
+
}
|
|
11609
|
+
else if (permission.state === 'granted') {
|
|
11610
|
+
resolve(true);
|
|
11611
|
+
}
|
|
11612
|
+
else if (permission.state === 'prompt') {
|
|
11613
|
+
try {
|
|
11614
|
+
navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) {
|
|
11615
|
+
stream.getTracks().forEach(function (t) { return t.stop(); });
|
|
11616
|
+
}).catch(function () {
|
|
11617
|
+
resolve(false);
|
|
11618
|
+
});
|
|
11619
|
+
permission.onchange = function () {
|
|
11620
|
+
_this.ngZone.run(function () {
|
|
11621
|
+
resolve(permission.state === 'granted' ? true : false);
|
|
11622
|
+
});
|
|
11623
|
+
};
|
|
11624
|
+
}
|
|
11625
|
+
catch (error) {
|
|
11626
|
+
resolve(false);
|
|
11627
|
+
}
|
|
11628
|
+
}
|
|
11629
|
+
return [2 /*return*/];
|
|
11630
|
+
}
|
|
11631
|
+
});
|
|
11632
|
+
}); });
|
|
11633
|
+
},
|
|
11634
|
+
enumerable: true,
|
|
11635
|
+
configurable: true
|
|
11636
|
+
});
|
|
11632
11637
|
SpeechRecognitionService.ctorParameters = function () { return [
|
|
11633
11638
|
{ type: LocaleService },
|
|
11634
11639
|
{ type: core.NgZone },
|