html - ios 10 youtube iframe 无法播放

标签 html ios iphone iframe autoplay

我在我的 HTML 代码中使用以下 iframe:

        <iframe src="<iframeurl>">?autoplay=1" frameborder="0" allowfullscreen></iframe>

在装有 iOS10 的 iPhone 上,这不会自动播放。我得到了红色的播放按钮和东西。在 windows chrome 和其他设备上,一切正常,自动播放正确启动。但不是用 iphone。

有什么我可以用 javascript 或通过操纵 URL 来实现自动播放吗?我知道 Apple 在 iOS10 之前禁止自动播放所以也许我在这里做错了..

最佳答案

您遇到这种情况是因为 Apple 不允许嵌入式媒体自动播放 — 用户总是启动播放。

YouTube's IFrame Player API documentation 中提到了这一点以及。不,我认为您不能也不应该覆盖它,因为这是一种不好的做法。

关于html - ios 10 youtube iframe 无法播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44472256/

相关文章:

iphone - 将 NSDate 转换为 mm/dd/yyyy

java - Ajax直接进入错误部分

ios - 尝试获取证书时出错 : The specified item could not be found in the keychain

ios - 客户端在收到完整响应 AFNetworking 之前关闭连接

ios - 通过 CMSampleBufferRef 数据传递到音频输出插孔

iphone - symbolicatecrash - 包名称中的空格阻止方法名称显示在崩溃报告中

iphone - 在 CALayer 中绘制的 UIImage 太模糊

javascript - 如何将文本添加到图像 anchor ?

html - 使用 div 标签以固定高度布局视口(viewport)

html - 如何根据特定字母定位一行文本?