On Songza you can pause / resume a song by pressing Spacebar.
How do they accomplish this? I guess these embedded players expose some kind of Javascript API? If they do, where is it documented?
On Songza you can pause / resume a song by pressing Spacebar.
How do they accomplish this? I guess these embedded players expose some kind of Javascript API? If they do, where is it documented?
Most players use a flash applet to capture keyboard input once you click on the player. On YouTube, if you click on the player, you can no longer scroll the page using the arrow keys because the flash player is capturing the input.
Regarding the documentation of how to control the players using javascript, here are the API docs:
The ExternalInterface class has two static methods call
and addCallback
. You can use them for communicating between an swf and the embedding html page. The linked livedocs page contains examples showing how this can be done.