9***@qq.com
9***@qq.com
  • 发布:2021-10-21 10:00
  • 更新:2023-06-25 15:36
  • 阅读:2472

【已解决】uniapp IOS 是否可以后台播放音频

分类:uni-app

IOS 端是否可以uni.createInnerAudioContext 播放音频 ,现在配置文件配置了 后台运行功能
"UIBackgroundModes" : [ "audio", "location" ]
IOS 端切换到后台 音频就不能播放?
我想知道IOS 是否可以后台播放音频,这个方向有必要进行下去没有?

2021-10-21 10:00 负责人:无 分享
已邀请:
王者地带

王者地带 - 5+混合APP开发教程网 | http://www.html5-app.com | 咨询QQ: 2564034335

  • 9***@qq.com (作者)

    感谢 没看到这个文档,我去试下

    2021-10-21 10:06

  • 9***@qq.com (作者)

    大神问下 uni.getBackgroundAudioManager(); 再次播放 无法播放什么原因

    if(that.isPay){

    console.log('赋值录音');

    that.innerAudioContext.onStop();

    that.innerAudioContext.title = '致爱丽丝';

    that.innerAudioContext.src = url;

    }else{

    console.log('初始化');

    that.innerAudioContext = uni.getBackgroundAudioManager();

    that.innerAudioContext.title = '致爱丽丝';

    that.innerAudioContext.singer = '暂无';

    that.innerAudioContext.src = url;

    that.isPay = true;

    that.innerAudioContext.onPlay(function(res){

    console.log('开始播放音频');

    });

    that.innerAudioContext.onEnded(function(res){

    console.log('播放音频完成
    ');

    });

    that.innerAudioContext.onError(function(err){

    console.log('播放音频错误*****',err);

    });

    }

    2021-10-21 10:58

9***@qq.com

9***@qq.com (作者)

已解决 that.innerAudioContext.play()

9***@qq.com

9***@qq.com (作者)

有人知道吗?

奥利奥饼干

奥利奥饼干

getBackgroundAudioManager不行, 安卓可以后台播放, ios不行

要回复问题请先登录注册