HTML and CSS Reference
In-Depth Information - 20, 0, endradians);
* Decide whether to draw the play or the stop button
case track.state.PAUSED:
case track.state.STOPPED:
case track.state.PLAYING:
As you can see, if the track state is paused or stopped, the play icon is drawn; if
the track is playing, the stop icon is drawn.
The full code for the playButton follows. You will notice that at the bottom of the
code sample, there is an event listener to bind the touch event for the canvas.
This will trigger the togglePlay() method.
app.playButton = function(id, track){
var canvas = document.getElementById(id),
context = canvas.getContext('2d'),
track = track,
_self = this; = {
x: (canvas.offsetHeight / 2),
y: (canvas.offsetHeight / 2)
canvas.dimensions = {
width: (canvas.offsetWidth),
height: (canvas.offsetHeight)
* Track callback methods
track.callbacks.didUpdateTime = function(time){
Search WWH ::

Custom Search