Ccaudio.js里面的getPlaying问题

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

e
return true;
}else{
var sourceNode = this._currentSource;
if(!this.playing && !sourceNode)
return true;
if(sourceNode"playbackState"] == null)
return this.

楼主能具体描述下报错么?
是什么平台上的什么浏览器?

照理来说this._currentSource这个值是必须存在的,如果不存在,造成楼主的报错的话,肯定是有哪里出错了。
楼主是肿么使用的时候报错的吖?

我就使用cc.audioEngine.isMusicPlaying() 而已,chrome浏览器,无论mac和pc都会出现。

我怀疑是web还没有加载好音乐,然后我调用这个判断导致。
cc.audioEngine.playMusic(“res/music.mp3”,false);

BTW: 有没有什么事件回调之类的办法用来判断这个音乐是否播完? 我现在是用scheduleUpdate 每帧来判断是否播完音乐,貌似比较SB。。。

怎么解决的

楼主的问题我也遇到了,特别是在调试的时候经常出现这个问题