Any idea how to disable auto play on embedded "Vine.co" videos?

CyrisXD picture CyrisXD · Jan 30, 2013 · Viewed 8.7k times · Source

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.

Answer

taesign picture taesign · Sep 1, 2015

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.