File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -315,8 +315,12 @@ cc.AudioEngine = cc.Class.extend(/** @lends cc.AudioEngine# */{
315315 this . _effectsVolume = volume ;
316316 }
317317 if ( this . _audioList ) {
318+ var au ;
318319 for ( var i in this . _audioList ) {
319- this . _audioList [ i ] . volume = this . _effectsVolume ;
320+ au = this . _audioList [ i ] ;
321+ if ( au ) {
322+ au . volume = this . _effectsVolume ;
323+ }
320324 }
321325 }
322326 } ,
@@ -359,8 +363,12 @@ cc.AudioEngine = cc.Class.extend(/** @lends cc.AudioEngine# */{
359363 */
360364 pauseAllEffects :function ( ) {
361365 if ( this . _audioList ) {
366+ var au ;
362367 for ( var i in this . _audioList ) {
363- this . _audioList [ i ] . pause ( ) ;
368+ au = this . _audioList [ i ] ;
369+ if ( au ) {
370+ au . pause ( ) ;
371+ }
364372 }
365373 }
366374 } ,
@@ -386,8 +394,12 @@ cc.AudioEngine = cc.Class.extend(/** @lends cc.AudioEngine# */{
386394 */
387395 resumeAllEffects :function ( ) {
388396 if ( this . _audioList ) {
397+ var au ;
389398 for ( var i in this . _audioList ) {
390- this . _audioList [ i ] . play ( ) ;
399+ au = this . _audioList [ i ] ;
400+ if ( au ) {
401+ au . play ( ) ;
402+ }
391403 }
392404 }
393405 } ,
@@ -414,9 +426,13 @@ cc.AudioEngine = cc.Class.extend(/** @lends cc.AudioEngine# */{
414426 */
415427 stopAllEffects :function ( ) {
416428 if ( this . _audioList ) {
429+ var au ;
417430 for ( var i in this . _audioList ) {
418- this . _audioList [ i ] . pause ( ) ;
419- this . _audioList [ i ] . currentTime = 0 ;
431+ au = this . _audioList [ i ] ;
432+ if ( au ) {
433+ au . pause ( ) ;
434+ au . currentTime = 0 ;
435+ }
420436 }
421437 }
422438 } ,
You can’t perform that action at this time.
0 commit comments