Optimize setBar event and handle non-array chapters in artplayer-plugin-chapter

This commit is contained in:
Harvey Zack committed 2024-06-03 01:11:35 +08:00
1 parent d8ff61acf7
commit f3db438d6b
3 files changed
+3 -1

No files matched your search

@@ -179,6 +179,7 @@ function artplayerPluginChapter(option = {}) {
} else setStyle($title, "display", "none");
}
function update(chapters = []) {
if (!Array.isArray(chapters)) return;
if (!chapters.length) return;
if (!art.duration) return;
chapters = chapters.sort((a, b)=>a.start - b.start);