mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-12 15:26:16 -08:00
add Artplayer.USE_RAF
This commit is contained in:
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') {
|
||||
|
||||
Reference in new issue
Block a user