From b4aaf81db7ebe32db01b10caabee33947c666a9d Mon Sep 17 00:00:00 2001 From: Pavle Goloskokovic Date: Sat, 14 Apr 2018 18:46:09 +0200 Subject: [PATCH] Storing data on each audio tag if it is locked (ont yet loaded) --- src/loader/filetypes/HTML5AudioFile.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/loader/filetypes/HTML5AudioFile.js b/src/loader/filetypes/HTML5AudioFile.js index 76be80282..68f36dba4 100644 --- a/src/loader/filetypes/HTML5AudioFile.js +++ b/src/loader/filetypes/HTML5AudioFile.js @@ -110,8 +110,14 @@ var HTML5AudioFile = new Class({ audio.dataset.name = this.key + ('0' + i).slice(-2); // Useful for debugging audio.dataset.used = 'false'; - if (!this.locked) + if (this.locked) { + audio.dataset.locked = 'true'; + } + else + { + audio.dataset.locked = 'false'; + audio.preload = 'auto'; audio.oncanplaythrough = this.onProgress.bind(this); audio.onerror = this.onError.bind(this);