删除多余事件

This commit is contained in:
Harvey committed 2019-11-28 10:10:29 +08:00
1 parent e0faa3fe68
commit 7ff61b4660
38 files changed
+266 -516

No files matched your search

+14 -16
View File
@@ -1,26 +1,24 @@
import { def } from '../utils';
export default function switchMix(art, player) {
const { i18n, notice, option } = art;
const { i18n, notice } = art;
function switchUrl(url, name, currentTime) {
if (url === player.url) return Promise.resolve(url);
if (url === player.url) return;
URL.revokeObjectURL(player.url);
return player.attachUrl(url).then(() => {
option.url = url;
player.playbackRate = false;
player.aspectRatio = false;
art.once('video:canplay', () => {
player.currentTime = currentTime;
});
if (player.playing) {
player.play = true;
}
if (name) {
notice.show = `${i18n.get('Switch video')}: ${name}`;
}
art.emit('switch', url);
player.url = url;
player.playbackRate = false;
player.aspectRatio = false;
art.once('video:canplay', () => {
player.currentTime = currentTime;
});
if (player.playing) {
player.play = true;
}
if (name) {
notice.show = `${i18n.get('Switch video')}: ${name}`;
}
art.emit('switch', url);
}
def(player, 'switchQuality', {