在页面中需要加个音频文件进行模仿。
在vue项目中,先定义好audio标签
方法一
然后设置guideVoice,值之后,监听canplaythrough事件,看是否可以播放,然后控制播放
方法二
一的方法有问题,在重复播放的时候就不播放了,我们使用这种方法
要先于这个渲染周期设置好播放的src
在电脑上测试可以,但是在iphonex手机上还有问题,经查是ios上面必须是用户点击触发之后才可以,不能自动播放
wx62ca408a2c56b 博主文章分类:js ©著作权
文章标签 ide ios safari 文章分类 JavaScript 前端开发
在页面中需要加个音频文件进行模仿。
在vue项目中,先定义好audio标签
然后设置guideVoice,值之后,监听canplaythrough事件,看是否可以播放,然后控制播放
一的方法有问题,在重复播放的时候就不播放了,我们使用这种方法
要先于这个渲染周期设置好播放的src
在电脑上测试可以,但是在iphonex手机上还有问题,经查是ios上面必须是用户点击触发之后才可以,不能自动播放
上一篇:mac制作gif图
下一篇:js获取dom元素位置函数
前端播放视频流
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M