修复异步切换画质bug

This commit is contained in:
Harvey Zack committed 2018-11-28 13:56:41 +08:00
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);
});
}
},
});