Skip to content

Commit 402aa27

Browse files
Skipping setting preload attribute and events on an audio tag on mobile devices
1 parent b33af6d commit 402aa27

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/loader/filetypes/HTML5AudioFile.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ var HTML5AudioFile = new Class({
7474
var audio = new Audio();
7575
audio.name = this.key + ('0' + i).slice(-2); // Useful for debugging
7676
audio.dataset.used = 'false';
77-
audio.preload = 'auto';
7877

79-
// TODO check if ios is locked
80-
81-
audio.oncanplaythrough = this.onProgress.bind(this);
82-
audio.onerror = this.onError.bind(this);
78+
if (!('ontouchstart' in window))
79+
{
80+
audio.preload = 'auto';
81+
audio.oncanplaythrough = this.onProgress.bind(this);
82+
audio.onerror = this.onError.bind(this);
83+
}
8384

8485
this.data.push(audio);
8586
}

0 commit comments

Comments
 (0)