黑色屏幕上的铬为Android html5视频

时间:2016-04-20 12:19:54

标签: android html5 google-chrome video html5-video

问题: 这些视频放在我的网站上:http://dege.cloud/(点击其中一张图片) 当我在桌面或firefox移动设备上加载页面时,一切都很好。 当相同的页面加载到chrome for android时,视频是黑色的,没有控件,视频没有音频,所以我不知道它是否播放。

预期结果: 视频应该可播放,hml5视频标签不会在移动设备上自动启动,但这不是问题。

分析: 视频的内容类型是正确的,检查设备上的控制台不会出错。 我给了webm和mp4版本的视频(摘自http://giphy.com/)。

视频的代码是:

<video autoplay muted loop class="img-responsive img-centered">
    <source src="img/portfolio/campominato-video.webm" type="video/webm" class="img-responsive img-centered">
    <source src="img/portfolio/campominato-video.mp4" type="video/mp4" class="img-responsive img-centered">
    <img src="img/portfolio/campominato-screen.png" class="img-responsive img-centered">
</video>

问题在于行动中的问题: https://jsfiddle.net/Dege/1es4516p/

1 个答案:

答案 0 :(得分:2)

据我所知,问题在于它会自动播放;虽然chrome Android 53将autoplay muted videos,但目前的默认版本(51)不会。

在任何情况下,如果您将ObjectMapper mapper = new ObjectMapper(); String jsonInString = "{'name' : 'gokul'}"; Staff obj = mapper.readValue(jsonInString, Staff.class); 属性添加到视频元素并按播放,则会正确播放视频,这表明它不是编码问题。

(FWIW,jsfiddle在用于加载视频的http方案中有3个斜线;这不是问题,但你可能想要修复它)

相关问题