const innerAudioContext = uni.createInnerAudioContext()
innerAudioContext.autoplay = true;
innerAudioContext.src = 'http://up_mp4.t57.cn/2018/1/03m/13/396131232171.m4a?st=w9L1QoW9ob6Grhbfq_YPtg&e=1603171428';
innerAudioContext.onPlay(() => {
alert(1)//没有弹出
});
- 发布:2020-10-20 12:47
- 更新:2022-03-03 10:52
- 阅读:1323
产品分类: uniapp/H5
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 2.9.3
浏览器平台: 微信内置浏览器
项目创建方式: HBuilderX
示例代码:
操作步骤:
const innerAudioContext = uni.createInnerAudioContext()
innerAudioContext.autoplay = true;
innerAudioContext.src = 'http://up_mp4.t57.cn/2018/1/03m/13/396131232171.m4a?st=w9L1QoW9ob6Grhbfq_YPtg&e=1603171428';
innerAudioContext.onPlay(() => {
alert(1)//没有弹出
});
const innerAudioContext = uni.createInnerAudioContext()
innerAudioContext.autoplay = true;
innerAudioContext.src = 'http://up_mp4.t57.cn/2018/1/03m/13/396131232171.m4a?st=w9L1QoW9ob6Grhbfq_YPtg&e=1603171428';
innerAudioContext.onPlay(() => {
alert(1)//没有弹出
});
预期结果:
可以播放
可以播放
实际结果:
可以播放
可以播放
bug描述:
ios在微信内置游览器上有时候可以播放音频有时候可以播放,又不可以播放,使用uni.createInnerAudioContext()在ios上有时候无法播放
3 个回复
1***@qq.com - we
解决了么 我也是这个问题
9***@qq.com
请问解决了吗
9***@qq.com
请问解决了吗
1***@qq.com
请问解决了吗,我也遇到了这个问题
2022-12-10 09:10
4***@qq.com
回复 1***@qq.com: 请问解决了吗?我也遇到了
2022-12-28 16:07