Stop video when close

In the homepage of my site, there is a slider with a video. When you click on the play button, the video comes up and if you click play it starts.But clicking in the close button, the video does not stop. There is any way of stop the video with JS?