mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
feat: Optimize chapter handling in artplayer-plugin-chapter
This commit is contained in:
1 parent
e11a2da806
commit
999988465c
3 files changed
+5
-3
No files matched your search
@@ -179,6 +179,8 @@ function artplayerPluginChapter(option = {}) {
|
||||
} else setStyle($title, "display", "none");
|
||||
}
|
||||
function update(chapters = []) {
|
||||
$chapters = [];
|
||||
$control.innerText = "";
|
||||
removeClass($player, "artplayer-plugin-chapter");
|
||||
if (!Array.isArray(chapters)) return;
|
||||
if (!chapters.length) return;
|
||||
@@ -207,7 +209,6 @@ function artplayerPluginChapter(option = {}) {
|
||||
end: chapters[i + 1].start,
|
||||
title: ""
|
||||
});
|
||||
$control.innerText = "";
|
||||
$chapters = chapters.map((chapter)=>{
|
||||
const $chapter = append($control, html);
|
||||
const start = clamp(chapter.start, 0, art.duration);
|
||||
|
||||
Reference in new issue
Block a user