I\'m trying to pause and play YouTube videos with the following code which is pretty much a copy from the Youtube API page:
In your HTML, have some buttons to control the video:
Using jQuery, bind an event listener (the click) to trigger a function on your player object:
$(function() {
$('#play').click(function() {
player.playVideo();
});
$('#pause').click(function() {
player.pauseVideo();
});
});
I built an app using YouTube's Player and Data api. Take what you need: https://github.com/HunterMeyer/YouTV