-
-
Save cesarkohl/e3a939ccaca22f105980 to your computer and use it in GitHub Desktop.
Youtube Pause Video
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var youtube_video = $('iframe'); | |
var url = youtube_video.attr('src'); // 1. First get the iframe URL | |
youtube_video.attr('src', ''); // 2. Then assign the src to null, this then stops the video been playing | |
youtube_video.attr('src', url); // If you need to reassign the URL back to your iframe, so when you hide and load it again you still have the link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment