收藏
回答

鸿蒙 5.1.0 BackgroundAudioManager 无法播放

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug BackgroundAudioManager 鸿蒙客户端 1.0.9 3.9.1、3.8.12、3.7.12都试了都能复现
const audioManager = wx.getBackgroundAudioManager(); // 背景音频管理实例
audioManager.src = 'xxxxx'
audioManager.onPlay((res) => {
        console.log('监听onPlay', res);
      });
      audioManager.onSeeked((res) => {
        console.log('监听onSeeked', res);
      });
      audioManager.onPause((res) => {
        console.log('监听onPause');
      });
      audioManager.onError((res) => {
        console.log('监听onError', res);
      });
      audioManager.onWaiting((res) => {
        console.log('监听onWaiting', res);
      });
      audioManager.onStop((res) => {
        console.log('监听onStop', res);
      });
      audioManager.onEnded((res) => {
        console.log('监听onEnded', res);
      });


已测试IOS、android、鸿蒙4是正常播放的,鸿蒙5.1.0版本 设置完BackgroundAudioManager的src后能获取到duration,但是没有自动触发播放和onplay,

触发BackgroundAudioManager.play,也不会触发onplay播放。基础库切换了3.9.1、3.8.12、3.7.12都能复现。




回答关注问题邀请回答
收藏

1 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    08-19

    请提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    08-19
    有用
    回复
登录 后发表内容