mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
优化回调分离
This commit is contained in:
1 parent
4b61098945
commit
ac1ba12767
11 files changed
+108
-53
No files matched your search
@@ -20,9 +20,16 @@ export default function playbackRate(art) {
|
||||
const { rate } = target.dataset;
|
||||
if (rate) {
|
||||
player.playbackRate(Number(rate));
|
||||
inverseClass(target, 'current');
|
||||
art.contextmenu.hide();
|
||||
}
|
||||
},
|
||||
callback: $menu => {
|
||||
art.on('playbackRate', rate => {
|
||||
const $current = Array.from($menu.querySelectorAll('span')).find(
|
||||
item => Number(item.dataset.rate) === rate
|
||||
);
|
||||
inverseClass($current, 'current');
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user