Categories
JavaScript Answers

How to stop a YouTube video with JavaScript?

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *