Giter Site home page Giter Site logo

game-asset-loader's People

Contributors

jhermsmeier avatar oampo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

game-asset-loader's Issues

Using Blob instead of BlobBuilder

Hi, I modified gal.filesystem.js to replace BlobBuilder with Blob (BlobBuilder doesn't work for chrome v24). Below is the modified code:

GALFS.prototype.saveAsset = function(key, url, callback, failCallback) {
  // BlobBuilder shim
//  var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;

  var root = this.root;
  var lookupTable = this.lookupTable;

  var xhr = new XMLHttpRequest();
  xhr.open('GET', url, true);
  xhr.responseType = 'blob';

  xhr.addEventListener('load', function() {
    createDir_(root, dirname_(key).split('/'), function(dir) {

      dir.getFile(basename_(key), {create: true}, function(fileEntry) {
        fileEntry.createWriter(function(writer) {

          writer.onwrite = function(e) {
            // Save this file in the path to URL lookup table.
            lookupTable[key] = fileEntry.toURL();
            callback();
          };

          writer.onerror = failCallback;

         // var bb = new BlobBuilder();
            var blob = new Blob([xhr.response], {type: ''});
        //  bb.append(xhr.response);
            writer.write(blob);
        //  writer.write(bb.getBlob());

        }, failCallback);
      }, failCallback);
    });
  });

  xhr.addEventListener('error', failCallback);
  xhr.send();
};

Now this works and the files are downloaded correctly but the onProgress function is not firing and the onLoaded function seems to fire only sometimes.. any insights?

storageInfo undefined

When I run the examples on Firefox and Chrome I get this error :
storageInfo is undefined

On the file gal.filesystem.js
Line number122

// Get quota
storageInfo.requestQuota(window.PERSISTENT, quota,
quotaCallback, onError);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.