This commit is contained in:
Peter Maquiran
2022-05-30 16:06:28 +01:00
7 changed files with 51 additions and 29 deletions
@@ -166,7 +166,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}, 1000);
this.getChatMembers();
//this.getMessageDB();
VoiceRecorder.requestAudioRecordingPermission();
this.deleteRecording();
this.loadFiles();
}
@@ -298,6 +298,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}
async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){
@@ -157,7 +157,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.scrollToBottom();
this.getChatMembers();
VoiceRecorder.requestAudioRecordingPermission();
this.deleteRecording();
this.loadFiles();
}
@@ -287,8 +287,9 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
}
async startRecording() {
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})) {
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})) {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){
if (this.recording) {
return;
@@ -298,11 +299,11 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.calculateDuration();
//}
}
else{
else {
this.toastService._badRequest('Para gravar uma mensagem de voz, permita o acesso do Gabinete Digital ao seu microfone.');
}
}
else{
else {
this.toastService._badRequest('Este dispositivo não tem capacidade para gravação de áudio!');
}
}