mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22: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
@@ -6,7 +6,6 @@ let i18nMap = {
|
||||
'Video info': '视频统计信息',
|
||||
Close: '关闭',
|
||||
'Video load failed': '视频加载失败',
|
||||
'Video loading is aborted': '视频加载被中止',
|
||||
Volume: '音量',
|
||||
Play: '播放',
|
||||
Pause: '暂停',
|
||||
@@ -40,7 +39,6 @@ let i18nMap = {
|
||||
'Video info': '影片統計訊息',
|
||||
Close: '關閉',
|
||||
'Video load failed': '影片載入失敗',
|
||||
'Video loading is aborted': '影片加載被中止',
|
||||
Volume: '音量',
|
||||
Play: '播放',
|
||||
Pause: '暫停',
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function attachUrlMix(art, player) {
|
||||
value: url => {
|
||||
const typeName = type || getExt(url);
|
||||
const typeCallback = customType[typeName];
|
||||
sleep().then(() => {
|
||||
return sleep().then(() => {
|
||||
if (typeName && typeCallback) {
|
||||
art.emit('beforeCustomType', typeName);
|
||||
typeCallback($video, player.returnUrl(url), art);
|
||||
|
||||
@@ -23,9 +23,9 @@ export default function eventInit(art, player) {
|
||||
});
|
||||
});
|
||||
|
||||
art.on('video:abort', () => {
|
||||
notice.show(`${i18n.get('Video loading is aborted')}`);
|
||||
});
|
||||
// art.on('video:abort', () => {
|
||||
|
||||
// });
|
||||
|
||||
art.on('video:canplay', () => {
|
||||
if (!firstCanplay) {
|
||||
|
||||
@@ -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