Created
October 17, 2013 14:36
-
-
Save alekskorovin/7026103 to your computer and use it in GitHub Desktop.
Reset a Video players - iframes from YouTube or Vimeo, etc.
This file contains hidden or 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
| // Reset a Video players - iframes from YouTube or Vimeo, etc. | |
| var resetIframeVideoPlayer = function () { | |
| var $videoPlayer = $(this), videoIframeSrc; | |
| // Store the src of iframe with video | |
| videoIframeSrc = $player.attr('src'); | |
| // Clear src attribute from an iframe | |
| $videoPlayer.attr('src', ''); | |
| // Reassign src attribute | |
| $videoPlayer.attr('src', videoIframeSrc); | |
| } | |
| // Found each of iframes with videos | |
| $.each($('iframe.embed-video'), resetIframeVideoPlayer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment