This commit is contained in:
Peter Maquiran
2022-03-21 15:12:20 +01:00
11 changed files with 60 additions and 33 deletions
@@ -291,7 +291,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64;
//console.log(recordData);
const fileName = new Date().getTime() + ".wav";
const fileName = new Date().getTime() + ".mp3";
//Save file
this.storage.set('fileName',fileName);
this.storage.set('recordData',result).then(() => {
@@ -357,8 +357,10 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
async sendAudio(fileName) {
const roomId = this.roomId
let audioFile;
this.storage.get('recordData').then((recordData) => {
console.log(recordData);
audioFile = recordData;
if(recordData.value.recordDataBase64.includes('data:audio')){
this.audioRecorded = recordData.value.recordDataBase64;
}
@@ -376,14 +378,16 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
this.wsChatMethodsService.getDmRoom(roomId).send({
file: {
"type": "aplication/audio",
"type": "application/audio",
/* "guid": '', */
"msDuration":audioFile.value.msDuration,
"mimeType":audioFile.value.mimeType,
},
attachments: [{
"title": fileName ,
"title_link": this.audioRecorded,
"title_link_download": true,
"type": "file"
"type": "audio"
}],
temporaryData: formData
})