video player add to web

This commit is contained in:
Eudes Inácio
2023-11-09 09:51:57 +01:00
parent deade1daa2
commit d864c70b9f
3 changed files with 19 additions and 10 deletions
@@ -221,15 +221,15 @@ export class NewPublicationPage implements OnInit {
/* this.convertVideoToBase64(data[0].fullPath) */
this.fileType = "video/mp4"
/* this.fileType = "video/mp4"
await Filesystem.writeFile({
path: data[0].name,
data: data[0].fullPath,
directory: FilesystemDirectory.Data,
}).then(async (dir) => {
console.log('DIR ', dir)
const base64Video = await this.convertVideoToBase64(dir.uri);
/* let resultUrl = decodeURIComponent(dir.uri);
const base64Video = await this.convertVideoToBase64(dir.uri); */
let resultUrl = decodeURIComponent('documents://' + data[0].fullPath);
Filesystem.readFile({ path: resultUrl, encoding: Encoding.UTF8, })
.then(async (content) => {
@@ -241,8 +241,8 @@ export class NewPublicationPage implements OnInit {
this.capturedVideo = "data:video/mp4;base64," + content.data;
this.photoOrVideo = false;
})
.catch((err) => console.error(err)); */
});
.catch((err) => console.error(err));
/* }); */
} catch (error) {
console.log('record video error: ', error)