>start pause stop Volume Progress
// 4. The API will call this function when the video player is ready. function onPlayerReady(event) { event.target.playVideo(); } // 5. The API calls this function when the player's state changes. // The function indicates that when playing a video (state=1), // the player should play for six seconds and then stop. function onPlayerStateChange(event) { if (event.data == YT.PlayerState.PLAYING) { $('#progressBar').show(); var playerTotalTime = player.getDuration(); mytimer = setInterval(function() { var playerCurrentTime = player.getCurrentTime(); var playerTimeDifference = (playerCurrentTime / playerTotalTime) * 100; progress(playerTimeDifference, $('#progressBar')); }, 1000); } else { clearTimeout(mytimer); $('#progressBar').hide(); } } function stopVideo() { player.stopVideo(); }