在移动设备上的 iframe HTML5 播放器(Android Chrome 和 Firefox)中没有自动播放? [英] no autoplay in iframe HTML5 player on mobile (Android Chrome and Firefox)?

查看:31
本文介绍了在移动设备上的 iframe HTML5 播放器(Android Chrome 和 Firefox)中没有自动播放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在使用标准 iframe 嵌入代码嵌入视频并像这样添加 autoplay=1 时遇到问题:

I've recently run into an issue when embedding a video with standard iframe embed code and adding autoplay=1 like this:

<iframe width="420" height="315" src="http://www.youtube.com/embed/Le4kjAIcj4k?rel=0&amp;autoplay=1" frameborder="0" allowfullscreen></iframe>

测试时的结果:

  • 如果 Flash 版本的播放器已加载(如果存在 Flash 且不存在 HTML5-beta 参与 cookie)
  • 它也适用于桌面上的 HTML5 版本
  • 不会在 HTML5 移动版中自动播放(在 Android 上测试4.1.2 使用 Firefox Mobile 和 Chrome 在此页面上,在 Android 上,您需要确保没有没有闪光灯).
  • autoplay works both on desktop and mobile if the Flash-version of the player is loaded (if Flash is present & no HTML5-beta participation cookie is present)
  • it works in the HTML5-version on the Desktop as well
  • but does not autoplay in the HTML5 mobile version (tested on Android 4.1.2 with both Firefox Mobile and Chrome on this page, on Android you need to make sure you don't have flash).

这是一个已知问题吗?有什么解决方法吗?

Is this a known issue? Any workaround?

推荐答案

当您在禁用 Flash 的浏览器中使用 <iframe> 播放器时,播放将通过 HTML5 <video> 标签.

When you use the <iframe> Player in a browser that has Flash disabled, playback is handled via HTML5 <video> tags.

Apple 明确禁止在 iOS Safari 中的 标签中自动播放媒体.

Apple explicitly prohibits autoplaying media in <video> tags in iOS Safari.

对于至少最新版本的默认 Android 浏览器或 Chrome.我强烈怀疑 Android Firefox 也有同样的限制.

This is also the case for at least recent versions the default Android Browser or in Chrome. I'd strongly suspect that Android Firefox has the same restriction.

这篇关于在移动设备上的 iframe HTML5 播放器(Android Chrome 和 Firefox)中没有自动播放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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