调用扫码的API后,扫码成功后,怎么就没办法调用audioCtx.play()呢

发布于 7 年前作者 xiulanhou7494 次浏览最后编辑 7 年前来自 ask

    wx.scanCode({

      onlyFromCamera: true,

      success: (res) => {

        app.data.audioCtx.play(); //此处无法播放…我看到audioId是同一个

        console.log(app.data.audioCtx);

      },

      fail:function(){

        app.data.audioCtx.play();

        wx.showToast({

          title: ‘扫描失败’,

          icon: ‘fail’,

          duration: 800

        })

      }

    });

1 回复
hzhao
hzhao1 楼5 年前

20000