Autoplay vimeo?
miguel-moya opened this issue · 1 comments
miguel-moya commented
I can open a vimeo video inside the modal but the video appears paused. Is it possible that it has autoplay when opening the modal?
jackmoore commented
Hi @miguel-moya, Colorbox is pretty agnostic about content so this is more of a Vimeo and/or browser issue.
I checked Vimeo's documentation about autoplay and put together this example for you:
$.colorbox({
html: '<iframe src="https://player.vimeo.com/video/76979871?autoplay=1&muted=1" width="640" height="360" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>'
})
Alternative example:
<a class='vimeo' href="http://player.vimeo.com/video/2285902?autoplay=1&muted=1">Flash / Video (Iframe/Direct Link To Vimeo)</a>
<script>
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
</script>
Note the inclusion of autoplay=1
and muted=1
in the querystring. The Vimeo documentation link I posted has more details if needed (Chrome refuses autoplay for unmuted videos).