视频不能在iOS10 Chrome上播放 [英] Video not playing on iOS10 Chrome

查看:693
本文介绍了视频不能在iOS10 Chrome上播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < video poster =sample。我只是无法找到此视频片段的错误。 jpg循环自动播放控件静音playinline> 
< source type =video / webmsrc =sample.webm>< / source>
< source type =video / mp4src =sample.mp4>< / source>
< / video>

视频在Safari中没有任何问题(没有针对早期版本的iOS进行测试,但是我的只关心自动播放问题?),但在Chrome上,我看到的唯一一件事是封面图片和一个不会触发任何东西的播放按钮。我错过了什么吗?我真的需要使用JS来实现它吗?



更新:使用iOS Chrome播放Webm文件似乎有问题 - 我尝试了几个文件不同的地点,他们似乎需要首先下载才能玩。


谷歌浏览器目前有一个错误,它不会自动播放 .webm 视频 。尝试使用以下网址发布的代码:



https://github.com/samdutton/simpl/blob/gh-pages/video/scripted/index .html



此外,请阅读移动浏览器中专门用于静音自动播放的问题:



https://github.com/whatwg/html/issues/976



阅读SO应该很有用帖子也是这样:

有效检测设备是否播放具有自动播放属性的静音视频


I just can't seem to locate what's wrong with this video snippet.

<video poster="sample.jpg" loop autoplay controls muted playsinline>
    <source type="video/webm" src="sample.webm"></source>
    <source type="video/mp4" src="sample.mp4"></source>
</video>

The video plays without any problems in Safari (haven't tested against earlier versions of iOS, but my only concern there is the autoplay issue?), but on Chrome the only thing I see is the cover image and a play button that doesn't trigger anything. Am I missing something? Do I really need to use JS to get it to work?

Update: It seems there's an issue with playing Webm files with iOS Chrome - I've tried several files from different locations and they seem to be needed to be downloaded first before being able to play.

解决方案

Google Chrome currently has a bug in which it will not autoplay a .webm video if it comes after anything else. Try to use a code published at: http://thenewcode.com/777/Create-Fullscreen-HTML5-Page-Background-Video

If previous advise does not help, try to use scripted playback examples (video.js and simpl) on Github:

https://github.com/videojs/video.js

https://github.com/samdutton/simpl/blob/gh-pages/video/scripted/index.html

Also, read the issue dedicated to muted autoplay in mobile browsers:

https://github.com/whatwg/html/issues/976

It must be useful to read S.O. post as well:

Efficiently detect if a device will play silent videos that have the autoplay attribute

这篇关于视频不能在iOS10 Chrome上播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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