localForage icon indicating copy to clipboard operation
localForage copied to clipboard

Blob mimetype not saved consistently across drivers

Open thgreasi opened this issue 11 years ago • 3 comments

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.

thgreasi avatar Dec 19 '14 21:12 thgreasi

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

stakach avatar Jan 14 '15 06:01 stakach

Unfortunately the iOS8/Yosemite versions of Safari DO support IndexedDB but have issues that means we can’t yet use them in localForage. (#254)

tofumatt avatar Jan 14 '15 06:01 tofumatt

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 () {
      });

niubility000 avatar Sep 08 '24 11:09 niubility000