optimize error handling; remove line before current time

This commit is contained in:
DIYgod 2018-03-14 00:59:28 +08:00
parent 454019fea0
commit 9864458475
No known key found for this signature in database
GPG Key ID: EC0B76A252D3EF67
3 changed files with 5 additions and 5 deletions

View File

@ -44,7 +44,7 @@ class Lrc {
this.parsed[index] = this.parse(xhr.responseText);
}
else {
console.log('Request was unsuccessful: ' + xhr.status);
this.player.notice(`LRC file request fails: status ${xhr.status}`);
this.parsed[index] = [['00:00', 'Not available']];
}

View File

@ -105,8 +105,8 @@ class APlayer {
this.audio.preload = this.options.preload;
for (let i = 0; i < this.events.audioEvents.length; i++) {
this.audio.addEventListener(this.events.audioEvents[i], () => {
this.events.trigger(this.events.audioEvents[i]);
this.audio.addEventListener(this.events.audioEvents[i], (e) => {
this.events.trigger(this.events.audioEvents[i], e);
});
}
@ -148,7 +148,7 @@ class APlayer {
// audio download error: an error occurs
this.on('error', () => {
this.notice('An audio error has occurred.', 0);
this.notice('An audio error has occurred.');
});
// multiple audio play

View File

@ -23,7 +23,7 @@
</div>
<div class="aplayer-time">
<span class="aplayer-time-inner">
- <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>
<span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>
</span>
<div class="aplayer-volume-wrap">
<button type="button" class="aplayer-icon aplayer-icon-volume-down">