Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

Check if youtube api player is paused

$
0
0

I have created a button that pauses and plays a youtube video on click. I am trying to check if the video is already paused if so play, if its playing then pause. isPaused is not a function. What is the function I am looking for?

document.getElementById("playButton").addEventListener('click', function (event) {    if(!!player.isPaused()){        player.playVideo();    }     else {        player.pauseVideo();    }});

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>