add Artplayer.USE_RAF

This commit is contained in:
Harvey Zack committed 2023-08-26 00:03:26 +08:00
1 parent 6fc1532ada
commit 9ba838aa52
10 files changed
+105 -11

No files matched your search

@@ -7,9 +7,15 @@ export default function miniProgressBar(art) {
$progressBar.style.display = 'none';
});
art.on('video:timeupdate', () => {
$progressBar.style.width = `${art.played * 100}%`;
});
if (art.constructor.USE_RAF) {
art.on('raf', () => {
$progressBar.style.width = `${art.played * 100}%`;
});
} else {
art.on('video:timeupdate', () => {
$progressBar.style.width = `${art.played * 100}%`;
});
}
art.on('setBar', (type, percentage) => {
if (type === 'played') {