Created
January 20, 2017 04:15
-
-
Save Bobz-zg/a1e3d174a8f8bf9cbd8145991d193250 to your computer and use it in GitHub Desktop.
Click to play Wistia Video via Javascript API
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
$('.play').click( function(event) { | |
if(event.preventDefault) { event.preventDefault(); } | |
$video = $(this).closest('iframe'); | |
if ( $video.hasClass('wistia_embed') ) { | |
window._wq = window._wq || []; | |
$video_id = /[^/]*$/.exec( $video.attr('src') )[0]; | |
_wq.push({ id: $video_id, onReady: function(video) { | |
video.play(); | |
}}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment