Audio permition asked on statRecording method

This commit is contained in:
Eudes Inácio
2022-05-27 16:53:09 +01:00
parent ce7cee0876
commit 1294a6f82a
4 changed files with 8 additions and 4 deletions
@@ -144,7 +144,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
}) })
VoiceRecorder.requestAudioRecordingPermission();
//this.loadFiles(); //this.loadFiles();
} }
@@ -289,6 +289,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async startRecording() { async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){ if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){ if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){ //if(await this.hasAudioRecordingPermission()){
+2 -1
View File
@@ -159,7 +159,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
}) })
VoiceRecorder.requestAudioRecordingPermission();
this.getChatMembers(); this.getChatMembers();
} }
@@ -222,6 +222,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async startRecording() { async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){ if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){ if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){ //if(await this.hasAudioRecordingPermission()){
@@ -166,7 +166,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
}, 1000); }, 1000);
this.getChatMembers(); this.getChatMembers();
//this.getMessageDB(); //this.getMessageDB();
VoiceRecorder.requestAudioRecordingPermission();
this.deleteRecording(); this.deleteRecording();
this.loadFiles(); this.loadFiles();
} }
@@ -298,6 +298,7 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
} }
async startRecording() { async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){ if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){ if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){ //if(await this.hasAudioRecordingPermission()){
@@ -157,7 +157,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.scrollToBottom(); this.scrollToBottom();
this.getChatMembers(); this.getChatMembers();
VoiceRecorder.requestAudioRecordingPermission();
this.deleteRecording(); this.deleteRecording();
this.loadFiles(); this.loadFiles();
} }
@@ -287,6 +287,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
} }
async startRecording() { async startRecording() {
VoiceRecorder.requestAudioRecordingPermission();
if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){ if(await VoiceRecorder.canDeviceVoiceRecord().then((result: GenericResponse) =>{return result.value})){
if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){ if(await VoiceRecorder.requestAudioRecordingPermission().then((result: GenericResponse) => {return result.value})){
//if(await this.hasAudioRecordingPermission()){ //if(await this.hasAudioRecordingPermission()){