cordova-plugin-wkwebview-engine icon indicating copy to clipboard operation
cordova-plugin-wkwebview-engine copied to clipboard

No access to local files from JS/HTML

Open doender opened this issue 8 years ago • 6 comments

I'm trying to play local audio files, video files and webworkers (referencing a local JS file) in wkwebview but none of them seem to load. However, local images are shown normally. I get no explicit error messages.

Am I missing some configuration directive?

doender avatar Oct 14 '16 23:10 doender

Where are you loading the files from? Wkwebview can't access any path except the app root

ghenry22 avatar Oct 14 '16 23:10 ghenry22

For audio for example, I'm using:

<audio src='assets/audio/test.mp3' controls></audio>

where assets is in the www folder.

doender avatar Oct 14 '16 23:10 doender

I was just checking that it was within the www folder as wkwebview cannot access files in other paths. It should be able to access that though I would think, if you look at the network request diagnostics in safari do you see any 404 not founds or similar errors? Once the app is running once attach the safari debug tools and hit refresh so you can monitor a load from scratch to catch any early console output or network request failures.

ghenry22 avatar Oct 17 '16 06:10 ghenry22

I get the following for an audio file:

image

doender avatar Oct 17 '16 09:10 doender

Any update on this? I really like this plugin, as the performance increase for lower end device is quite amazing.

doender avatar Oct 18 '16 15:10 doender

Were anyone was able to fix this issue?

mrameezraja avatar Nov 10 '16 14:11 mrameezraja