Skip to content

Instantly share code, notes, and snippets.

@Rakeshbagri
Last active September 5, 2017 11:23
Show Gist options
  • Save Rakeshbagri/ad93c79f85ddb2869410473328f8c157 to your computer and use it in GitHub Desktop.
Save Rakeshbagri/ad93c79f85ddb2869410473328f8c157 to your computer and use it in GitHub Desktop.
how to autoplay vimeo video use javascript
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