问题
I'm working on a little side project.
I'm able to embed and display specified vine.co video's with
<iframe id='eFrame' src='http://vine.co/v/bJjdTLBnwx1/card' width='380' height='380' frameborder='0'></iframe>
I'm pulling in the links via Ajax to display them on the page, however now the problem is they are all autoplaying, which causes major browser lag.
Anyone know how I can append them to the body with autoplay disabled? This project is all client side, so I'll be limited to client-side languages. (ie Javascript/jQuery etc..)
Much appreciated, Cheers.
回答1:
I'm probably late but you can pass some command via the postMessage javascript's function. It worked for me :
var iframe = document.getElementById(id);
iframe.contentWindow.postMessage('pause', '*');
Same construction for play, mute and unmute.
回答2:
<iframe id='eFrame' src='http://vine.co/v/bJjdTLBnwx1/embed/simple' width='320' height='320' frameborder='0'></iframe>
Try this it will be of much help have better controls and only on pressing the play button it will run.
Try it.
来源:https://stackoverflow.com/questions/14615370/any-idea-how-to-disable-auto-play-on-embedded-vine-co-videos