mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-14 08:26:16 -08:00
fix: Remove unused code for progress hover in artplayer
This commit is contained in:
1 parent
3e3e355e34
commit
33eba49a3b
7 files changed
+21
-30
No files matched your search
@@ -161,7 +161,7 @@ function artplayerPluginChapter({ chapters = [] }) {
|
||||
let $chapters = [];
|
||||
const $progress = art.query(".art-control-progress-inner");
|
||||
const $control = append($progress, '<div class="art-chapters"></div>');
|
||||
function setBar(type, percentage) {
|
||||
art.on("setBar", (type, percentage)=>{
|
||||
const currentTime = art.duration * percentage;
|
||||
const index = $chapters.findIndex(({ $chapter })=>{
|
||||
const start = parseFloat($chapter.dataset.start);
|
||||
@@ -176,6 +176,7 @@ function artplayerPluginChapter({ chapters = [] }) {
|
||||
loaded: $loaded,
|
||||
played: $played
|
||||
}[type];
|
||||
if (!$target) return;
|
||||
const duration = parseFloat($chapter.dataset.duration);
|
||||
const start = parseFloat($chapter.dataset.start);
|
||||
const end = parseFloat($chapter.dataset.end);
|
||||
@@ -186,9 +187,6 @@ function artplayerPluginChapter({ chapters = [] }) {
|
||||
setStyle($target, "width", `${_percentage * 100}%`);
|
||||
}
|
||||
}
|
||||
}
|
||||
art.on("setBar", (type, percentage)=>{
|
||||
setBar(type, percentage);
|
||||
});
|
||||
art.on("video:loadedmetadata", ()=>{
|
||||
$control.innerHTML = "";
|
||||
|
||||
Reference in new issue
Block a user