Reputation: 3011
I am using iFrame to display video on www.ridesharebuddy.com. I am using autoplay feature in this.
I am doing it this way.
<iframe src="//player.vimeo.com/video/82633004?title=0&byline=0&portrait=0&autoplay=1" width="500" height="320" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
But sometimes it starts even before the whole page is loaded. Can i give some delay in this to load video after 5-10 seconds?
Upvotes: 1
Views: 3608
Reputation: 343
You can append the video link after the page is loaded via jQuery.
<iframe id="vimeo_frame" src="#" width="500" height="320" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<script>
jQuery(window).load(function()
{
var vimeo_frame = jQuery('#vimeo_frame'),
vimeo_src = 'player.vimeo.com/video/82633004?title=0&byline=0&portrait=0&autoplay=1';
setTimeout(function()
{
vimeo_frame.attr('src', vimeo_src);
}, 2000);
}
</script>
Don't forget to include jQuery ;-)
Upvotes: 1