chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

Feature request: add Video (mp4) instructions into the doc #215

Open badpenguin opened 7 years ago

badpenguin commented 7 years ago

It would be nice to have support for video tag and his src attribute for small (less then 10MB) mp4 videos.

badpenguin commented 7 years ago

I did some preliminary tests and i got those 2 problems: 1) this console log error: Refused to load the image 'android-webview-video-poster:default_video_poster/401735702592099287' because it violates the following Content Security Policy directive 2) got the mp4 cached but the video tag using cdvfile:// url is not working

badpenguin commented 7 years ago

About point 1 i tried adding allow-intent or allow origin in config.xml and didn't worked.

About point 2 maybe cvdfile have to be converted to another url as in the example on https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/ ?

badpenguin commented 7 years ago

I tracked down the problem to the file transfer plugin only downloading a small part of the movie. Maybe there is a problem between it and the server? It seems unable to download the whole mp4 as a single file. I tried to disable on the server the range requests but i had no luck. Any idea?

badpenguin commented 7 years ago

Ok problem 1 is related to a vimeo iframe i used, so its unrelated. Ok problem 2 was lighttpd configuration on the server and the android emulator not working with the video tag.

Imgcache.js works out of the box with mp4 and Android 7 at least using the src attribute directly with the video tag.

So please add to the doc :)