I made the switch from desktop to mobile development, using cordova.
Cordova and mobile platforms are kinda weird when it comes to path and URLs for files. Cordova mainly offers two urls: file:// and cdvfile:// to access videos on the mobile device. The apps itself are served via file://android_asset/www/index.html (as prod build) or via http:// (dev build). Also there are many restrictions that need to be adjusted to load locally available videos (CORS and mobile device access whitelisting). Using a standard <video> element with one of the urls above as element.src works quite nice. Setting the crossorigin attribute to anonymous can make the video unloadable (which is a must to display it onto canvas). I was able to load a video in a prod build (served as file://) from file:// with anonymous crossorigin. At least I could instruct the VideoContext to play, however the screen was black, yet the audio gives sound.
From MDN video element reference:
crossorigin This enumerated attribute indicates whether to use CORS to fetch the related image. CORS-enabled resources can be reused in the element without being tainted
Since I set CORS to whitelist my video origin, which finally made the VideoContext play but only sound, I'm wondering whether you experienced this field before and if you have a good advise to make this library usable on mobile devices (using cordova).
Thanks
I made the switch from desktop to mobile development, using cordova.
Cordova and mobile platforms are kinda weird when it comes to path and URLs for files. Cordova mainly offers two urls:
file://andcdvfile://to access videos on the mobile device. The apps itself are served viafile://android_asset/www/index.html(as prod build) or viahttp://(dev build). Also there are many restrictions that need to be adjusted to load locally available videos (CORS and mobile device access whitelisting). Using a standard<video>element with one of the urls above aselement.srcworks quite nice. Setting thecrossoriginattribute toanonymouscan make the video unloadable (which is a must to display it onto canvas). I was able to load a video in a prod build (served asfile://) fromfile://with anonymous crossorigin. At least I could instruct theVideoContextto play, however the screen was black, yet the audio gives sound.From MDN video element reference:
Since I set CORS to whitelist my video origin, which finally made the
VideoContextplay but only sound, I'm wondering whether you experienced this field before and if you have a good advise to make this library usable on mobile devices (using cordova).Thanks