mirror of
https://github.com/photonstorm/phaser
synced 2024-12-17 16:43:30 +00:00
Skipping setting preload attribute and events on an audio tag on mobile devices
This commit is contained in:
parent
b33af6d2aa
commit
402aa27ff3
1 changed files with 6 additions and 5 deletions
|
@ -74,12 +74,13 @@ var HTML5AudioFile = new Class({
|
|||
var audio = new Audio();
|
||||
audio.name = this.key + ('0' + i).slice(-2); // Useful for debugging
|
||||
audio.dataset.used = 'false';
|
||||
|
||||
if (!('ontouchstart' in window))
|
||||
{
|
||||
audio.preload = 'auto';
|
||||
|
||||
// TODO check if ios is locked
|
||||
|
||||
audio.oncanplaythrough = this.onProgress.bind(this);
|
||||
audio.onerror = this.onError.bind(this);
|
||||
}
|
||||
|
||||
this.data.push(audio);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue