Reputation: 11
In the book Build an HTML5 Game on page 17, it asks to add the library Modernizr with the following feature detections:
I couldn't find Modernizr.load() and HTML5 Audio. Also the builder looked different that what I was expecting.
Upvotes: 1
Views: 670
Reputation: 74
I agree with the previous answer, you can't download Modernizr with the function Modernizr.load(). Although, you can download all files, scripts, and more from the book at https://nostarch.com/html5game by clicking on 'Download source code [...]', just below the 'Contents | Reviews' buttons. In the ZIP directory just downloaded, you will be able to find the old Modernizr module containing Modernizr.load() in C:\Users*user*\Downloads\Build an HTML5 Game Source Files\Build an HTML5 Game Source Files\Chapter_1.zip\Chapter_1_js. It is named modernizr.js and normally, you should be able to work with it.
Upvotes: 0
Reputation: 4259
The component you are looking for is Web Audio API
.
Also, the function Modernizr.load()
is included in all Modernizr packages by default.
For the Modernizr.load()
method, sorry for the confusion.
The Modernizr.load()
is not included anymore, as it was essentially another library named yepnope.js
. And then, the yepnope.js
library was deprecated, because the developers felt that its use had run its course.
The authors of yepnope feel that the front-end community now offers better software for loading scripts, as well as conditionally loading scripts.
The documentation of yepnope.js
is still online. I would recommend reading it, as well as Modernizr's documentation, in order to understand what Modernizr.load()
was supposed to do and come up with another solution.
Upvotes: 1