Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 210
CyrisXD Avatar asked Nov 26 '22 09:11

CyrisXD


1 Answers

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.

like image 82
taesign Avatar answered Nov 29 '22 04:11

taesign