mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
优化整体结构
This commit is contained in:
1 parent
9f9cb0e036
commit
487e865017
34 files changed
+505
-427
No files matched your search
@@ -5,13 +5,9 @@ export default function seekMix(art, player) {
|
||||
|
||||
Object.defineProperty(player, 'seek', {
|
||||
value: time => {
|
||||
let newTime = Math.max(time, 0);
|
||||
if (player.duration) {
|
||||
newTime = Math.min(newTime, player.duration);
|
||||
}
|
||||
player.currentTime = newTime;
|
||||
notice.show(`${secondToTime(newTime)} / ${secondToTime(player.duration)}`);
|
||||
art.emit('seek', newTime);
|
||||
player.currentTime = time;
|
||||
notice.show(`${secondToTime(time)} / ${secondToTime(player.duration)}`);
|
||||
art.emit('seek', time);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user