getPlaying: function(){
if(!this._playing){
return this._playing;
}
if(this._AUDIO_TYPE === “AUDIO”){
var audio = this._element;
if(!audio || this._pause){
this._playing = false;
return false;
}else if(audio.ended){
this._playing = false;
return false;
}else
return true;
}else{
var sourceNode = this._currentSource;
if(!this._playing && !sourceNode)
return true;
if(sourceNode"playbackState"] == null)
return this._playing;
else
return this._currentTime + this._context.currentTime - this._startTime < this._currentSource.buffer.duration;
}
},
里面的
if(!this._playing && !sourceNode)
return true;
能不能改为
if(!this._playing || !sourceNode)
return true;
web版本经常因为这个报错,说的是playbackState没有值就调用了
Uncaught TypeError: Cannot read property ‘playbackState’ of null
cc.Audio.cc.Class.extend.getPlaying
cc.audioEngine.isMusicPlaying