lodash /
lodash
A modern JavaScript utility library delivering modularity, performance, & extras.
88/100 healthLoading repository data…
jussi-kalliokoski / repository
A javascript library to preload all kinds of content, be it text, xml, audio, video or image, with simple syntax.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
#html5Preloader
With the growing use of HTML5 and it taking over the browser game scene, developers need an easy API to preload their resources on to the browser. html5-preloader aims to offer this, and in a compact, yet customizable way. html5-preloader supports almost all of the data types out there, from mp4 to XML, and with flexible fallback support.
addFiles('file1.abc', 'file2.abc', ...) syntax or you can use 'myIdentifier*:file1.abc' to specify an identifier for the file (for fetching the file afterwards, if necessary) and you can combine these with the flexible alternate filepath syntax, ie. 'myFile*:file1.abc||alternate1.abc||alternate2.abc' to provide fallbacks where necessary.errorevent.finish.getFile(identifier) function. You can fetch all loaded files by omitting an identifier.First, include the script to your page (you can download the latest stable version from the downloads). Next, you need to create an instance of the html5-preloader:
var myLoader = html5Preloader();
Now you should probably add some files to load, that's pretty straightforward to do:
// You can call the .addFiles() function
// To shorten load times, you should always offer the .mp3 as a last alternative.
myLoader.addFiles('file1', 'mysound*:sound.ogg||sound.mp3');
// Or you can always add the files on construct, like this:
myLoader = html5Preloader('file1', 'mysound*:sound.ogg||sound.mp3');
Maybe you want to know when all the files have been preloaded, and are available to use and then log that.
myLoader.on('finish', function(){ console.log('All assets loaded.'); });
Or maybe we'd want to log all errors that occur.
myLoader.on('error', function(e){ console.error(e); });
html5Preloader is licensed under MIT License.
.onfinish = a; becomes .on('finish', a);)..nowLoading (because of above)Selected from shared topics, language and repository description—not editorial ratings.
lodash /
A modern JavaScript utility library delivering modularity, performance, & extras.
88/100 healthccxt /
A cryptocurrency trading API with more than 100 crypto and prediction exchanges in JavaScript / TypeScript / Python / C# / PHP / Go / Java
96/100 healthsolidjs /
A declarative, efficient, and flexible JavaScript library for building user interfaces.
sorrycc /
🐢 A collection of awesome browser-side JavaScript libraries, resources and shiny things.
81/100 healthmotiondivision /
A modern animation library for React and JavaScript
97/100 healthfloating-ui /
A JavaScript library to position floating elements and create interactions for them.
97/100 health