This commit is contained in:
tiago.kayaya
2022-03-04 18:46:56 +01:00
parent 0c9d5275a6
commit 9fcd6f67c5
8 changed files with 60 additions and 34 deletions
+12 -5
View File
@@ -83,6 +83,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
LoadedDocument: any = null;
recording = false;
allowTyping = true;
storedFileNames = [];
lastAudioRecorded = '';
durationDisplay = '';
@@ -162,14 +163,14 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
onStart: ev => {
Haptics.impact({ style: ImpactStyle.Light })
this.startRecording();
this.calculateDuration();
//this.calculateDuration();
},
onEnd: ev => {
Haptics.impact({ style: ImpactStyle.Light })
this.stopRecording();
setTimeout(() => {
/* setTimeout(() => {
this.loadFiles();
}, 500);
}, 500); */
}
}, true);
longpress.enable();
@@ -210,9 +211,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}
this.recording = true;
VoiceRecorder.startRecording();
this.calculateDuration();
}
stopRecording() {
this.allowTyping = false;
console.log('Stop');
if (!this.recording) {
return;
@@ -232,6 +235,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
})
}
})
setTimeout(() => {
this.loadFiles();
}, 500);
}
async deleteRecording(fileName){
@@ -239,6 +245,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
directory: Directory.Data,
path: fileName
});
this.allowTyping = true;
this.lastAudioRecorded = '';
this.loadFiles();
}
@@ -421,11 +428,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
"type": "audio/aac",
"guid": '',
/* "guid": '', */
},
attachments: [{
"title": fileName ,
"title_link": audioRef,
"title_link": base64Response.url,
"title_link_download": true,
"type": "file"
}],