I've created an offline web app which shows in remote chrome debugging console as correctly caching all the files and it shows that it is correctly offline capable. The video, listed in the manifest shows as downloaded into the cache but when i turn on airplane mode and try to play, it shows an empty video.
How do I get a video to play offline?
Cache Manifest
CACHE MANIFEST
CACHE:
main.js
video.mp4
HTML link to manifest
<html manifest="cache.manifest">
Is there a way to do this?
For some reason, the only mobile browser that will play cached videos is Firefox on Android. However, there is a solution (For Safari iOS8+, Chrome, Firefox - I haven't tested IE) - they will play a video blob in an objectURL even offline!
What you do is this:
request = transaction.objectStore( "myobjectstorename" ).get( savedId )
if ( !event.target.result ) downloadVideo()
XMLHttpRequest
GET
request and set the response type videoRequest.responseType = "blob";
CODE To Put in page as object url:
var URL = window.URL || window.webkitURL;
//Make into a data URL
var videoURL = URL.createObjectURL( videoFile) ;
//Set video src to ObjectURL
document.getElementById( id ).setAttribute( "src", videoURL );
Modified the code from here:
http://www.misfitgeek.com/html5-off-line-storing-and-retrieving-videos-with-indexeddb/