webchataudio icon indicating copy to clipboard operation
webchataudio copied to clipboard

提供了一个写法解决该库初始化语音为00:00的bug

Open csonchen opened this issue 7 years ago • 2 comments

var it = setInterval(function() { var updateTime = self.updateTotalTime(); if (updateTime !== '00:00') { clearInterval(it); } }, 100); 这样写可以解决一下bug

csonchen avatar May 11 '17 04:05 csonchen

@csonchen 好的,谢谢,我测试后合并

warpcgd avatar May 12 '17 03:05 warpcgd

也可以在init函数里面增加一个监听器:

            init: function() {
                var a = this;
                var i = 0;
                a.Audio.addEventListener("canplay", function()
                    {
                        a.updateTotalTime();
                    }
                );
                this.events();
                "" !== this.settings.src && this.changeSrc(this.settings.src);
                this.settings.autoplay && this.play()
            },

ihewro avatar Nov 27 '17 14:11 ihewro