backgroundAudioManager 安卓系统无法触发onPlay

发布于 7 年前作者 gang1513730 次浏览最后编辑 7 年前来自 ask
  1. SDKVersion:"1.9.97"

  2. language:"zh_CN"

  3. model:"Letv X500"

  4. system:"Andrioid 6.0"

  5. version:"6.6.5"


backgroundAudioManager 安卓系统无法触发onPlay、onPauseonStop,为什么?IOS和微信工具下是可以的,有人知道吗?bug?

//app.js

App({

    onLaunch: function () {

    var that = this;

    backgroundAudioManager.onPlay(function (res) {

    console.log(‘音乐打开’)

    that.globalData.isPlaying = true;

    })

    backgroundAudioManager.onPause(function (res) {

    console.log(‘音乐暂停’)

    that.globalData.isPlaying = false;

    })

})

3 回复
naqiu
naqiu1 楼6 年前

wechatide://minicode/geuJ5nm868Yg

luoguiying
luoguiying2 楼6 年前

我知道错在哪了,非常感谢!