wx.createInnerAudioContext出现问题
发布于 5 年前 作者 leiwan 9098 次浏览 来自 问答

开发者工具在调用seek方法后,onTimeUpdate监听会失效

以下是关键部分代码:

onLoad() {

    audioContext.onTimeUpdate(function(e) {

        let presentSecond = (parseInt(audioContext.currentTime % 60)).toString();

        that.setData({

            currentTime: parseInt(audioContext.currentTime * 100) / 100,

            presentMinute: parseInt(audioContext.currentTime / 60).toString(),

            presentSecond: presentSecond.length == 1 ? ‘0’ + presentSecond : presentSecond,

        });

},

dragSlider(e) {

    console.log(e)

    if (e.type == ‘changing’) {

      audioContext.seek(e.detail.value / 100);

    } else if (e.type == ‘change’) {

        this.setData({

            currentTime: e.detail.value / 100,

        });

        audioContext.seek(e.detail.value / 100);

    }

},

在开发者工具滑动滑块之后,上方的onTimeUpdate监听失效,Andriod和iOS真机没有问题。

希望尽快修复

2 回复

不清楚是不是移动滑块时频繁seek造成的问题,但是真机均有效。

回到顶部