任何想法如何禁用嵌入式“Vine.co”上的自动播放视频? [英] Any idea how to disable auto play on embedded "Vine.co" videos?

查看:88
本文介绍了任何想法如何禁用嵌入式“Vine.co”上的自动播放视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开展一个小小的项目。

I'm working on a little side project.

我能够嵌入并显示指定的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.

这篇关于任何想法如何禁用嵌入式“Vine.co”上的自动播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆