Skip to content
tmcw edited this page May 24, 2012 · 3 revisions

playcanvas(canvasElement)

The main API of playcanvas: this takes an HTML5 Canvas element and returns a player instance.

var title = document.getElementById('title');
var title_player = playcanvas(title);

player.play()

Starts the canvas player.

player.pause()

Stops the player temporarily. player.play() will start where it left off.

player.stop()

Stops the player and rewinds it to 0.

player.n_notes()

Returns the number of notes available in the current style.