HTML5 Canvas [120]
displayed on the canvas. This is just our first step toward integrating audio with the canvas, but it should give you a good idea of how we will start to use audio elements and manipulate them through JavaScript.CH7EX3: Audio Properties And The Canvas
Figure 7-3 shows what this application looks like when it is executed in a web browser.
Figure 7-3. Showing audio properties on the canvas
There are also a few attributes displayed at the bottom of this list that we have not discussed. They all come from calls to the canPlayType() function of HTMLAudioElement. We are only displaying these right now, but in Example 7-3 we will make use of this function to help us decide which sound to dynamically load in JavaScript.
Example 7-3. Audio properties and the canvas
0%
NOTE
This process is explained in detail in Chapter 6, where we warned that some browsers do not fire events for embedded