所有浏览器的HTML视频自动播放问题 [英] Html video autoplay issue for all browsers

查看:1150
本文介绍了所有浏览器的HTML视频自动播放问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在移动浏览器上自动播放html视频时遇到问题.最初,我是使用autoplay和playinline属性来完成的.它可以工作,但是几天前它停止在移动设备上工作.第一次尝试,它实际上不适用于移动Safari,但对于CriO(iOS中的Chrome)来说还可以.现在,我尝试了一些解决方案,并注意到了这些问题:

I have an issue with autoplaying html video on mobile browsers. At first, I did it with autoplay and playsinline attributes. It worked but a few days ago it stopped working on mobile devices. First time I've tried, it was not working on mobile safari actually but was ok for CriOs (chrome in ios). Now I tried some solutions and noticed those :

-如果我将MP4视频用作源,则可以在台式机Chrome和Safari上运行.
-如果我使用WebM,则只能在台式机Chrome浏览器上运行.
-当页面加载有Javascript时,我尝试播放视频,但是它也无法正常工作.

-If I use MP4 video for my source, it works on desktop Chrome and Safari.
-If I use WebM, it works on just Desktop Chrome.
-I've tried to play the video when page loads with Javascript, and it didn't work either.

现在也不再在移动chrome上工作.几天前它正在工作,但现在不工作.我找不到任何有关新版本的信息.有人知道有关此问题的任何解决方案吗?

It's no more working on mobile chrome now,too. A few days ago it was working but not now. I couldn't find anything about a new release or something like that. Does anyone know any solution about this issue ?

推荐答案

现在禁止自动播放,以防止强迫用户在该设备上下载太多数据,特别是在有很多人连接不良的情况下.

Autoplay is being blocked now to prevent forcing user to download too much data on there devices, especially when so many people may have bad connection.

在下面查看这些文章.现在,只有在用户发起的情况下,移动设备上的视频才能播放.

Check out these articles below. Now, videos on mobile devices can only play, if initiated by the user.

Google Chrome浏览器将阻止自动播放视频从2018年1月开始

播放还是不播放播放-Safari 11和Chrome 64的新自动播放策略

这篇关于所有浏览器的HTML视频自动播放问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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