mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 02:01:20 -08:00
优化svg
This commit is contained in:
1 parent
6d0f3cad14
commit
5c037ad08f
25 files changed
+102
-128
No files matched your search
@@ -6,22 +6,13 @@ export default class Time {
|
||||
}
|
||||
|
||||
apply(art, $control) {
|
||||
$control.innerHTML = '00:00 / 00:00';
|
||||
|
||||
function setTime() {
|
||||
function getTime() {
|
||||
$control.innerHTML = `${secondToTime(art.player.currentTime)} / ${secondToTime(art.player.duration)}`;
|
||||
}
|
||||
|
||||
art.on('video:canplay', () => {
|
||||
setTime();
|
||||
});
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
setTime();
|
||||
});
|
||||
|
||||
art.on('video:seeking', () => {
|
||||
setTime();
|
||||
getTime();
|
||||
['video:loadedmetadata', 'video:timeupdate', 'video:progress'].forEach(event => {
|
||||
art.on(event, getTime);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user