From bad220061124f6c9495276f7691d906f2b91472b Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 5 Jul 2018 00:14:56 +0800 Subject: [PATCH] fix notice not display when error event triggered --- src/js/player.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index d780369..76c1dd9 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -545,10 +545,12 @@ class DPlayer { clearTimeout(this.noticeTime); } this.events.trigger('notice_show', text); - this.noticeTime = setTimeout(() => { - this.template.notice.style.opacity = 0; - this.events.trigger('notice_hide'); - }, time); + if (time > 0) { + this.noticeTime = setTimeout(() => { + this.template.notice.style.opacity = 0; + this.events.trigger('notice_hide'); + }, time); + } } resize () {