Skip to content

Commit 541cd83

Browse files
Using object property instead of local var
1 parent 81f3b56 commit 541cd83

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/loader/filetypes/HTML5AudioFile.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ var HTML5AudioFile = new Class({
7171
this.filesLoaded = 0;
7272
this.percentComplete = 0;
7373

74-
var touchLocked = 'ontouchstart' in window;
75-
7674
for(var i = 0; i < instances; i++)
7775
{
7876
var audio = new Audio();
7977
audio.dataset.name = this.key + ('0' + i).slice(-2); // Useful for debugging
8078
audio.dataset.used = 'false';
8179

82-
if (!touchLocked)
80+
if (!this.touchLocked)
8381
{
8482
audio.preload = 'auto';
8583
audio.oncanplaythrough = this.onProgress.bind(this);
@@ -94,13 +92,13 @@ var HTML5AudioFile = new Class({
9492
audio = this.data[i];
9593
audio.src = GetURL(this, baseURL || '');
9694

97-
if (!touchLocked)
95+
if (!this.touchLocked)
9896
{
9997
audio.load();
10098
}
10199
}
102100

103-
if (touchLocked)
101+
if (this.touchLocked)
104102
{
105103
setTimeout(function ()
106104
{

0 commit comments

Comments
 (0)