natjs / nat

A powerful kit for adding native functionalities to your weex app.
http://natjs.com
282 stars 25 forks source link

Nat.audio.play在ios11中无法调用回调 #55

Closed weenta closed 5 years ago

weenta commented 5 years ago

// ios11 回调并没有被调用

Nat.audio.play('http://cdn.instapp.io/nat/samples/audio.mp3', (err) => {
        if (err) {
          Nat.toast('[ERROR] ' + JSON.stringify(err))
          return
        }

        Nat.toast('started')
      })
weenta commented 5 years ago

Nat.video.play 在ios11中有相同的问题 在android中以上两个都可以正常调用回调

13601313270 commented 5 years ago

我尝试的结果是,这个回调,没法监听初始化的那次播放。

当你执行Nat.audio.pause(),然后再执行Nat.audio.play,这一次可以触发回掉函数。 image 通过看源码,好想实现上也确实是这样实现的,有oc基础的可以改一下源码

weenta commented 5 years ago

thanks for your help, appreciate it @13601313270