@@ -74,27 +74,25 @@ var HTML5AudioSoundManager = new Class({
7474 } ,
7575 unlock : function ( ) {
7676 var _this = this ;
77- if ( this . touchLocked ) {
78- var unlock_1 = function ( ) {
79- document . body . removeEventListener ( 'touchend' , unlock_1 ) ;
80- var allTags = [ ] ;
81- _this . game . cache . audio . entries . each ( function ( key , tags ) {
82- for ( var i = 0 ; i < tags . length ; i ++ ) {
83- allTags . push ( tags [ i ] ) ;
84- }
85- return true ;
86- } ) ;
87- var lastTag = allTags [ allTags . length - 1 ] ;
88- lastTag . oncanplaythrough = function ( ) {
89- lastTag . oncanplaythrough = null ;
90- _this . touchUnlocked = true ;
91- } ;
92- allTags . forEach ( function ( tag ) {
93- tag . load ( ) ;
94- } ) ;
77+ var unlock = function ( ) {
78+ document . body . removeEventListener ( 'touchend' , unlock ) ;
79+ var allTags = [ ] ;
80+ _this . game . cache . audio . entries . each ( function ( key , tags ) {
81+ for ( var i = 0 ; i < tags . length ; i ++ ) {
82+ allTags . push ( tags [ i ] ) ;
83+ }
84+ return true ;
85+ } ) ;
86+ var lastTag = allTags [ allTags . length - 1 ] ;
87+ lastTag . oncanplaythrough = function ( ) {
88+ lastTag . oncanplaythrough = null ;
89+ _this . touchUnlocked = true ;
9590 } ;
96- document . body . addEventListener ( 'touchend' , unlock_1 , false ) ;
97- }
91+ allTags . forEach ( function ( tag ) {
92+ tag . load ( ) ;
93+ } ) ;
94+ } ;
95+ document . body . addEventListener ( 'touchend' , unlock , false ) ;
9896 } ,
9997 onBlur : function ( ) {
10098 this . forEachActiveSound ( function ( sound ) {
0 commit comments