views:

158

answers:

3

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?

+2  A: 

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:

Ben S
+1  A: 

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.

Amarghosh
A: 

Looking through Imeem's javascript reference I can't see any way to control the player through javascript.

Or am I missing something obvious?