mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-17 10:01:20 -08:00
Optimize setBar event and remove unnecessary class manipulation in artplayer-plugin-chapter
This commit is contained in:
1 parent
f3db438d6b
commit
5160dcabca
3 files changed
+6
-9
No files matched your search
@@ -179,6 +179,7 @@ function artplayerPluginChapter(option = {}) {
|
||||
} else setStyle($title, "display", "none");
|
||||
}
|
||||
function update(chapters = []) {
|
||||
removeClass($player, "artplayer-plugin-chapter");
|
||||
if (!Array.isArray(chapters)) return;
|
||||
if (!chapters.length) return;
|
||||
if (!art.duration) return;
|
||||
@@ -224,8 +225,7 @@ function artplayerPluginChapter(option = {}) {
|
||||
$played: query(".art-progress-played", $chapter)
|
||||
};
|
||||
});
|
||||
if ($chapters.length) addClass($player, "artplayer-plugin-chapter");
|
||||
else removeClass($player, "artplayer-plugin-chapter");
|
||||
addClass($player, "artplayer-plugin-chapter");
|
||||
art.emit("setBar", "loaded", art.loaded || 0);
|
||||
}
|
||||
art.on("setBar", (type, percentage, event)=>{
|
||||
|
||||
Reference in new issue
Block a user