Last active
September 5, 2017 11:23
-
-
Save Rakeshbagri/ad93c79f85ddb2869410473328f8c157 to your computer and use it in GitHub Desktop.
how to autoplay vimeo video use javascript
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
use player.js and small script code | |
<script src="https://player.vimeo.com/api/player.js"></script> | |
<script> | |
$(document).ready(function(){ | |
var iframe = document.querySelector('iframe'); | |
var player = new Vimeo.Player(iframe); | |
player.play(); | |
player.on('play', function() { | |
alert('played the video!'); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment