mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix share content
This commit is contained in:
@@ -790,16 +790,21 @@ export class NewPublicationPage implements OnInit {
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||
|
||||
Filesystem.readFile({ path: fullPath }).then(async (content) => {
|
||||
let fileObject;
|
||||
try {
|
||||
fileObject = {
|
||||
FileBase64: this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
|
||||
console.log('shared base', content.data)
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(fileObject)
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: this.removeTextBeforeSlash(content.data, ','),
|
||||
extension: FileExtension,
|
||||
FileType: this.checkFileType.checkFileType(FileExtension) as any,
|
||||
OriginalFileName: 'shared'
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
} catch (error) {
|
||||
console.log('error shared filesystem', error)
|
||||
}
|
||||
@@ -811,7 +816,6 @@ export class NewPublicationPage implements OnInit {
|
||||
path: '',
|
||||
});
|
||||
|
||||
let fileObject = {};
|
||||
this.videoconvertService.convertVideo(fullPath, directory.uri, filename, 'mp4').then(async () => {
|
||||
await Filesystem.readFile({ path: `${directory.uri}${filename}.mp4` })
|
||||
|
||||
@@ -835,7 +839,7 @@ export class NewPublicationPage implements OnInit {
|
||||
newAttachment.needUpload()
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
fileObject = {};
|
||||
|
||||
const deleteSecretFile = async () => {
|
||||
await Filesystem.deleteFile({
|
||||
path: `${filename}.mp4`,
|
||||
@@ -844,7 +848,7 @@ export class NewPublicationPage implements OnInit {
|
||||
};
|
||||
deleteSecretFile().then((value) => {
|
||||
console.log('delete file', value)
|
||||
fileObject = {};
|
||||
|
||||
})
|
||||
.catch((erro) => console.error('read converted video erro ', erro));
|
||||
});
|
||||
@@ -862,26 +866,35 @@ export class NewPublicationPage implements OnInit {
|
||||
shareContentAndroid(resultUrl, FileExtension) {
|
||||
|
||||
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
|
||||
let fileObject;
|
||||
let newAttachment: PublicationAttachmentEntity;
|
||||
try {
|
||||
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
|
||||
fileObject = {
|
||||
FileBase64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: 'data:image/jpeg;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
extension: FileExtension,
|
||||
FileType: this.checkFileType.checkFileType(FileExtension) as any,
|
||||
OriginalFileName: 'shared'
|
||||
}
|
||||
)
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
|
||||
fileObject = {
|
||||
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
FileExtension: FileExtension,
|
||||
OriginalFileName: 'shared',
|
||||
}
|
||||
|
||||
const newAttachment = new PublicationAttachmentEntity(
|
||||
{
|
||||
base64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
|
||||
extension: 'mp4',
|
||||
FileType: this.checkFileType.checkFileType('mp4') as any,
|
||||
OriginalFileName: 'shared'
|
||||
}
|
||||
)
|
||||
newAttachment.needUpload()
|
||||
|
||||
}
|
||||
console.log('shared base', content.data)
|
||||
|
||||
this.PublicationFromMvService.form.Files.push(fileObject)
|
||||
this.PublicationFromMvService.form.Files.push(newAttachment)
|
||||
} catch (error) {
|
||||
console.log('error shared filesystem', error)
|
||||
}
|
||||
|
||||
@@ -219,6 +219,9 @@ export class RoomService {
|
||||
if (difference < 0) {
|
||||
|
||||
this.deleteRoom();
|
||||
if(this.chatOpen) {
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user