mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
some changes
This commit is contained in:
@@ -141,6 +141,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
if (this.intent) {
|
||||
this.filecontent = true
|
||||
this.capturedImage = 'data:image/jpeg;base64,' + this.intent;
|
||||
}
|
||||
|
||||
@@ -151,8 +152,12 @@ export class NewPublicationPage implements OnInit {
|
||||
recursive: true
|
||||
});
|
||||
|
||||
|
||||
// this.takePicture();
|
||||
document.addEventListener("click", clickOutside, false);
|
||||
function clickOutside(e) {
|
||||
const inside = document.getElementById('container-multiselect').contains(e.target);
|
||||
this.photoOrVideo = false;
|
||||
console.log(this.photoOrVideo)
|
||||
}
|
||||
}
|
||||
|
||||
// in use
|
||||
@@ -210,19 +215,25 @@ export class NewPublicationPage implements OnInit {
|
||||
const data = await this.mediaCapture.captureVideo(options)
|
||||
this.video = data[0];
|
||||
console.log(data)
|
||||
const originalFilePath = 'file:///storage/emulated/0/DCIM/Camera/20231110_125118.mp4';
|
||||
const mediaFile = new Media();
|
||||
mediaFile.create(data[0].fullPath)
|
||||
console.log(mediaFile)
|
||||
this.mediaFileToBase64(data[0])
|
||||
.then((base64Data) => {
|
||||
console.log('Base64 data:', base64Data);
|
||||
// Now you can use the base64 data as needed
|
||||
const savedFile = await Filesystem.copy({
|
||||
from: data[0].fullPath, // directory prop removed, Capacitor parses filename for us
|
||||
to: "video.mp4",
|
||||
toDirectory: FilesystemDirectory.Data
|
||||
});
|
||||
console.log(savedFile.uri)
|
||||
Filesystem.readFile({ path: savedFile.uri })
|
||||
|
||||
.then(async (content) => {
|
||||
console.log(content)
|
||||
this.filecontent = true;
|
||||
this.fileType = "video"
|
||||
this.capturedVideo = content.data;
|
||||
console.log(this.capturedVideo)
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error converting to base64:', error);
|
||||
// Handle errors
|
||||
});
|
||||
.catch((err) => console.error(err));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
@@ -651,4 +662,6 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user