mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-12 06:26:16 -08:00
27 lines
746 B
JavaScript
27 lines
746 B
JavaScript
export default function miniProgressBar(art) {
|
|
art.on('ready', () => {
|
|
art.layers.add({
|
|
name: 'miniProgressBar',
|
|
mounted($progressBar) {
|
|
art.on('destroy', () => {
|
|
$progressBar.style.display = 'none';
|
|
});
|
|
|
|
art.on('video:timeupdate', () => {
|
|
$progressBar.style.width = `${art.played * 100}%`;
|
|
});
|
|
|
|
art.on('setBar', (type, percentage) => {
|
|
if (type === 'played') {
|
|
$progressBar.style.width = `${percentage * 100}%`;
|
|
}
|
|
});
|
|
},
|
|
});
|
|
});
|
|
|
|
return {
|
|
name: 'miniProgressBar',
|
|
};
|
|
}
|