Problem loading video file

Asked

Viewed 29 times

0

I’m creating an app to watch a 360 video. I’m using this plugin: https://cordovavrview.tangodev.it/

This plugin uses Google VR View as a base. In this case it has a function called playVideo() which takes two parameters: file name and playback options.

When my video is in the folder www, that is, when I compile and Gero APK, the video works normally.

But when you have a video that’s in your phone’s memory, it’s not working. I am using the Cordova + Ionic plugin (Cordova-plugin-file) to get the file that is in the Download folder.

I’m using the function checkFile() to check if the file exists. If yes, execute the function playVideo() with the file path. But it doesn’t work. The error is this: error while loading video.

It seems that this path doesn’t work, but the checkFile function works. I’ve already made a mistake on purpose and the function actually works.

Is it security policy? I don’t know what it could be.

let path  = this.file.externalRootDirectory + 'Download';
let video = 'Video.mp4';

this.file.checkFile(path, video).then((data) => { 
   window['VrView'].playVideo(path + '/' + video, options);
}).catch((err) => {
    console.log('Erro', err);
});

1 answer

0


I managed to solve that problem. I installed the plugin Cordova-plugin-Whitelist and put in the config.xml the configuration:

<allow-navigation href="*" />

Browser other questions tagged

You are not signed in. Login or sign up in order to post.