在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jussi-kalliokoski/html5Preloader.js开源软件地址:https://github.com/jussi-kalliokoski/html5Preloader.js开源编程语言:JavaScript 100.0%开源软件介绍:#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. Why Choose H5P?
Features
ExamplesInitializingFirst, 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(); File addingNow 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'); EventsMaybe 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); }); Licensehtml5Preloader is licensed under MIT License. Changelog0.60 - A complete rewrite
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论