GithubHelp home page GithubHelp logo

shvilam / localcacheloader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sgmnt/localcacheloader

38.0 38.0 5.0 499 KB

Adobe Air LocalCacheLoader Will save file in the filesystem and then retrieve it from there. Persistent manger

Home Page: http://shvilam.github.io/LocalCacheLoader/

License: MIT License

ActionScript 100.00%

localcacheloader's People

Contributors

hrfm avatar sgmnt avatar shvilam 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

localcacheloader's Issues

Help is needed!

Help is needed!

For the NetStream loader it doesn't have the optimal solution it first save the file to local >disc and then play. t will be perfect if it could buffer the stream and in end create file out of >it.

It is what I do in one of my demo project using Thread to download files concurrently.

I use an URLStream to download internet files and each 0.5s, I write in a FileStream what there's is in the content loader using a ByteArray buffer, even if the user pause and terminate the Thread and restart the download again, what I do is I restart the download from the cache, I check first the file size didn't change on the server, if it has changed (could happen), I start the download again but from scratch, to know if the size of the of file has changed on the server I use SQLite to store the info.

You can have a look at the Runnable (a bit the same than a Worker but managed by a Thread and created in-memory): https://github.com/doublefx/easyWorker/blob/master/moreFlexDemo/downloadFileThread-Demo/src/infrastructure/thread/impl/DownloadFileRunnable.as

I hope it will help you to achieve your goal but if you have any question about the implementation, just ask.

Another use case

I suppose it might be useful to share potential use cases (I guess there is such thing as "use case driven development").

You have AIR app, desktop or mobile โ€“ doesn't matter, but think of it as an app for exhibition. It is data driven and that data comes from server (usually it's editable by some sort of CMS). So you want to pre-cache all the assets first on the startup, then start the app.

I can imagine, it is possible to do with the current version (simply by loading every asset). But there is really no point to use actual loader classes โ€“ it would be better to download them via Loader.loadBytes() and directly put the into storage directory.

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.