mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
修复异步切换画质bug
This commit is contained in:
1 parent
946a2da8a9
commit
2f1e7a0b55
6 files changed
+31
-34
No files matched your search
@@ -10,16 +10,17 @@ export default function switchMix(art, player) {
|
||||
if (url !== option.url) {
|
||||
const { isPlaying } = art;
|
||||
const { currentTime } = player;
|
||||
player.attachUrl(url);
|
||||
option.url = url;
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
player.seek(currentTime);
|
||||
if (isPlaying) {
|
||||
player.play();
|
||||
}
|
||||
notice.show(`${i18n.get('Switch video')}: ${name}`);
|
||||
art.emit('switch', url);
|
||||
player.attachUrl(url).then(() => {
|
||||
option.url = url;
|
||||
player.playbackRateRemove();
|
||||
player.aspectRatioRemove();
|
||||
player.seek(currentTime);
|
||||
if (isPlaying) {
|
||||
player.play();
|
||||
}
|
||||
notice.show(`${i18n.get('Switch video')}: ${name}`);
|
||||
art.emit('switch', url);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user