autoplay = 1不适用于< iframe&gt ;;在移动设备上播放视频 [英] autoplay=1 not working for <iframe> in playing video in mobile devices

查看:169
本文介绍了autoplay = 1不适用于< iframe&gt ;;在移动设备上播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理视频.当我单击视频缩略图"时,会出现一个弹出窗口并在其中播放视频,我需要在弹出窗口打开时开始播放视频(无需单击播放"按钮).我尝试了以下代码.

I'm working with video. When i click on Video Thumbnail a pop appears and Video plays in that,I need to start play the video (without clicking the play button) when popup opened.I tried with code below.

它在Web上运行完美,但在iPhone,iPad等移动设备上却无法运行

It was working perfect in web but not in mobile devices like iPhone ,iPad

<iframe
        title="YouTube video player"
        id="videoFrame"
        class="youtube_iframe" src="http://www.youtube.com/embed/JW5meKfy3fY?wmode=opaque&amp;autoplay=1"
        frameborder="0"   width="395" height="280"        allowfullscreen=""        scrolling="no">
</iframe>

但在弹出窗口中打开视频时不会自动播放. 预先感谢

But not auto played when video is opend in popup. thankx in advancee

推荐答案

要在iframe链接中添加静音,请像& muted = 1"一样使用它.完整的链接将类似于:

To add muted in an iframe link use it like "&muted=1". The complete link will be something like:

<iframe id="video-iframe" src="https://player.vimeo.com/video/125472391?api=1&player_id=video-iframe&autoplay=1&muted=1&loop=1&color=ffffff" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="0"></iframe>

这篇关于autoplay = 1不适用于&lt; iframe&gt ;;在移动设备上播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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