You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
------------------ 原始邮件 ------------------
发件人: "cq-wangyong"<notifications@github.com>;
发送时间: 2019年9月19日(星期四) 下午5:32
收件人: "haizlin/fe-interview"<fe-interview@noreply.github.com>;
抄送: "云"<1276830496@qq.com>; "Comment"<comment@noreply.github.com>;
主题: Re: [haizlin/fe-interview] [html] 第156天 HTML5的video在有的移动端设备无法自动播放?怎么解决? (#1221)
我试了一下对于音频audio标签,可以用touchstart和WeixinJSBridgeReady的方法,但是视频video却不行啊,各位老哥也是这样么
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
试下 muted 这个属性呢 …
------------------ 原始邮件 ------------------ 发件人: "cq-wangyong"notifications@github.com; 发送时间: 2019年9月19日(星期四) 下午5:32 收件人: "haizlin/fe-interview"fe-interview@noreply.github.com; 抄送: "云"1276830496@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [haizlin/fe-interview] [html] 第156天 HTML5的video在有的移动端设备无法自动播放?怎么解决? (#1221) 我试了一下对于音频audio标签,可以用touchstart和WeixinJSBridgeReady的方法,但是视频video却不行啊,各位老哥也是这样么 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Activity
mannymu commentedon Sep 19, 2019
在chrome 也无法自动播放。。没有办法,无解
Jianhang1015 commentedon Sep 19, 2019
介入微信的sdk, 然后调用skd内置的方法
Xiaohantx commentedon Sep 19, 2019
正常浏览器下无解,微信内置浏览器,可以绑定WeixinJSBridgeReady实现自动播放
chenyunping66 commentedon Sep 19, 2019
避免自动播放浪费流量,手机网页访问带有audio的页面不能自动播放。
一、利用微信的JSAPI的创建页面监听WeixinJSBridgeReady()是实现:
<audio autoplay="autopaly" loop="loop" id="audios"> <source src="music/bng.mp3" type="audio/mp3" /> </audio><script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script><script> document.addEventListener('WeixinJSBridgeReady', function() { document.getElementById('audios').play() }) </script>二、添加控制属性(controls),让用户手动触发
<audio autopaly ="autoplay" loop="loop" id="audios" controls="controls"> <source src=".mp3音乐路径" type="audio/mp3"/> <audio>三、添加触摸监听,当用户打开浏览出,触摸屏幕事件来监听播放
document.addEventLinstener('touchstart',function{ document.getEmlementById(“audios").play } )cq-wangyong commentedon Sep 19, 2019
我试了一下对于音频audio标签,可以用touchstart和WeixinJSBridgeReady的方法,但是视频video却不行啊,各位老哥也是这样么
chenyunping66 commentedon Sep 19, 2019
cq-wangyong commentedon Sep 19, 2019
这个属性是静音,和自动播放没关系吧
Children-look-word commentedon Sep 20, 2019
我最近碰到 一个 video 问题 就是 我在内网上 用video标签播放下载地址,但是考虑到一些格式不支持播放,以及一些视频编码不一样,所以我考虑用video.js 纯粹滴 flash播放,但是好像有个问题就是不知道为什么我基本falsh的文件swf好像就是引入不进去,我已经放在啦内网本地文件中,而且也在video-falsh源码中滴swf 路径也去掉啦,但还是播放不出来。不知道是什么问题
HUGY1 commentedon Nov 30, 2019
video不能自动播放的意义在于浏览器怕突然播放的声音会吓到人,设置muted静音是有一点作用的。但是大多数无解,只能曲线救国,设置播放按钮之类或者行为触发