Playing, pausing and stopping the player are trivial operations with the JavaScript API. In fact, the only playback function that cannot be called from JavaScript is the fullscreen toggle. This is due to security limitations.
This example demonstrates calling player functions through JavaScript
Control the video from JavaScript:
Here's the code for this demo. The jwplayer().play(), jwplayer().setMute() and jwplayer().stop() functions take care of the controls.
<div id="container"></div>
<script type="text/javascript">
jwplayer("container").setup({
file: "/videos/bunny.mp4",
flashplayer: "jwplayer/jwplayer.swf",
image: "/thumbs/bunny.jpg",
height: 270,
width: 480
});
</script>
<ul>
<li><a href="#" onclick="jwplayer().play();">Toggle the playback</a></li>
<li><a href="#" onclick="jwplayer().setMute();">Toggle the audio</a></li>
<li><a href="#" onclick="jwplayer().stop();">Stop playback</a></li>
</ul>
Some ideas for enhancing this functionality: