new option: preload

This commit is contained in:
DIYgod
2016-06-13 14:23:51 +08:00
parent c5776b2a78
commit 12fc04957d
5 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -455,7 +455,12 @@
if ((this.multiple && !this.audios[indexMusic]) || this.playIndex === -1) {
this.audio = document.createElement("audio");
this.audio.src = this.music.url;
this.audio.preload = this.isMobile ? 'none' : 'metadata';
if (this.option.preload) {
this.audio.preload = this.option.preload;
}
else {
this.audio.preload = this.isMobile ? 'none' : 'metadata';
}
// show audio time: the metadata has loaded or changed
this.audio.addEventListener('durationchange', () => {