bloqhead
10/8/2013 - 7:50 PM

How to pause all Vimeo videos. Source: http://base42.nl/easiest-way-to-pause-all-vimeo-videos-on-your-site/

<script type="text/javascript">
$(function() {
	// Vimeo pauser
	function pauseVimeo() {
	    $('iframe[src*="vimeo.com"]').each( function (iterator, object) {
	        var url = $(object).attr('src').split('?')[0];
	        object.contentWindow.postMessage(JSON.stringify({ method:"pause" }), url);
	    });
	}
	// Attach it to a button
	$('#pause').on( 'click', pauseVimeo );
});
</script>