0

Is there anyway to shut down a YouTube video that you've embedded on your page? It seems like they play to the end, no matter what. What I'd like is some way to use JavaScript to send a STOP signal to the YouTube player to completely disengage from the video and show whatever was there before the video was started. An END signal from the video player would also be nice, that called my JavaScript when the video finished.

By the way, I notice when I right-click the playing video that one option is "About the HTML5 Player" so apparently YouTube is using the HTML5 player. That might make the task of communicating with the player with JavaScript a bit easier.

Thanks for any ideas.

Steve
  • 4,534
  • 9
  • 52
  • 110

1 Answers1

2

Yes, there is a way. Use what official documentation says: player.stopVideo(). If you have a problem with it, see Stop a youtube video with jquery? and How can I stop a video with Javascript in Youtube? as they not only contain solutions to common problems but discuss alternative ways of achieving the same goal.

Community
  • 1
  • 1
Grzegorz Adam Kowalski
  • 5,243
  • 3
  • 29
  • 40
  • Fantastic! This is exactly what I was looking for. They won't let me award the points for another 19 hours. – Steve May 21 '14 at 13:54