任何想法如何在嵌入式& quot; Vine.co& quot;上禁用自动播放.影片? [英] Any idea how to disable auto play on embedded "Vine.co" videos?
问题描述
我正在做一个小项目.
我可以嵌入和显示指定的vine.co视频,
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>
我正在通过Ajax拉入链接以在页面上显示它们,但是现在的问题是它们都在自动播放,这会导致浏览器出现严重滞后.
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.
任何人都知道如何在禁用自动播放的情况下将它们附加到身体上吗?这个项目是所有客户端的,所以我将限于客户端语言. (即Javascript/jQuery等.)
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..)
非常感谢,干杯.
推荐答案
我可能已经晚了,但是您可以通过postMessage javascript函数传递一些命令.它对我有用:
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.
这篇关于任何想法如何在嵌入式& quot; Vine.co& quot;上禁用自动播放.影片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!