File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,21 @@ function WebAudio() {
1010 this . initialize . apply ( this , arguments ) ;
1111}
1212
13+ WebAudio . _standAlone = ( function ( top ) {
14+ return ! top . ResourceHandler ;
15+ } ) ( this ) ;
16+
1317WebAudio . prototype . initialize = function ( url ) {
1418 if ( ! WebAudio . _initialized ) {
1519 WebAudio . initialize ( ) ;
1620 }
1721 this . clear ( ) ;
18- this . _loader = ResourceHandler . createLoader ( url , this . _load . bind ( this , url ) , function ( ) {
19- this . _hasError = true ;
20- } . bind ( this ) ) ;
22+
23+ if ( ! WebAudio . _standAlone ) {
24+ this . _loader = ResourceHandler . createLoader ( url , this . _load . bind ( this , url ) , function ( ) {
25+ this . _hasError = true ;
26+ } . bind ( this ) ) ;
27+ }
2128 this . _load ( url ) ;
2229 this . _url = url ;
2330} ;
@@ -500,7 +507,7 @@ WebAudio.prototype._load = function(url) {
500507 this . _onXhrLoad ( xhr ) ;
501508 }
502509 } . bind ( this ) ;
503- xhr . onerror = this . _loader ;
510+ xhr . onerror = this . _loader || function ( ) { this . _hasError = true ; } . bind ( this ) ;
504511 xhr . send ( ) ;
505512 }
506513} ;
You can’t perform that action at this time.
0 commit comments