localForage
localForage copied to clipboard
Blob mimetype not saved consistently across drivers
As discussed on #322, WebSql and localStorage drivers lose the mimetype of Blobs. It works just on IndexedDB.
Keep in mind that PhantomJS < 2.0 does not support the Blob constructor.
Loading videos from blobs hits this issue on Safari - also it looks like the latest safari is still having the blobs serialized, however it supports IndexDB according to caniuse
Unfortunately the iOS8/Yosemite versions of Safari DO support IndexedDB but have issues that means we can’t yet use them in localForage. (#254)
Now, iOS 17.5 works great. I just use localforage to cache video and audio, it works great in windows, iphone. (maybe also in android, I don't have android phone.)
fetch( this.raw )
.then((response) => response.blob())
.then((blob) => {
localforage.setItem(srtUrl, blob, function () {
// Do other things once the value has been saved.
})
.catch((error) => {
console.error("Error fetching or converting URL:", error);
});
},
vm = this;
localforage
.getItem(srtUrl)
.then(function (value) {
vm.raw = URL.createObjectURL(value);
})
.catch(function () {
});