Sometimes, we want to stop a YouTube video with JavaScript.
In this article, we’ll look at how to stop a YouTube video with JavaScript.
How to stop a YouTube video with JavaScript?
To stop a YouTube video with JavaScript, we call the stopVideo method.
For instance, we write
player.stopVideo();
to call the YouTube player‘s stopVideo method to stop the video.
Conclusion
To stop a YouTube video with JavaScript, we call the stopVideo method.