build all packages

This commit is contained in:
zhw2590582 committed 2019-04-21 11:57:44 +08:00
1 parent 9de6e12671
commit 3b172ffa93
31 files changed
+447 -58

No files matched your search

@@ -0,0 +1,43 @@
export default function switchMix(art, player) {
const { i18n, notice, option } = art;
Object.defineProperty(player, 'switchQuality', {
value: (url, name = 'unknown') => {
if (url !== option.url) {
const { currentTime, playing } = player;
return player.attachUrl(url).then(() => {
option.url = url;
player.playbackRateRemove();
player.aspectRatioRemove();
player.seek(currentTime);
if (playing) {
player.play();
}
notice.show(`${i18n.get('Switch video')}: ${name}`);
art.emit('switch', url);
});
}
return null;
},
});
Object.defineProperty(player, 'switchUrl', {
value: (url, name = 'unknown') => {
if (url !== option.url) {
const { playing } = player;
return player.attachUrl(url).then(() => {
option.url = url;
player.playbackRateRemove();
player.aspectRatioRemove();
player.seek(0);
if (playing) {
player.play();
}
notice.show(`${i18n.get('Switch video')}: ${name}`);
art.emit('switch', url);
});
}
return null;
},
});
}