简化player接口

This commit is contained in:
Harvey Zack committed 2019-06-06 10:37:57 +08:00
1 parent 1b69b28ba1
commit 52b6693da2
41 files changed
+624 -690

No files matched your search

+6 -6
View File
@@ -7,13 +7,13 @@ export default function switchMix(art, player) {
const { currentTime, playing } = player;
return player.attachUrl(url).then(() => {
option.url = url;
player.playbackRateRemove();
player.aspectRatioRemove();
player.playbackRate = false;
player.aspectRatio = false;
art.once('video:canplay', () => {
player.currentTime = currentTime;
});
if (playing) {
player.play();
player.play = true;
}
notice.show(`${i18n.get('Switch video')}: ${name}`);
art.emit('switch', url);
@@ -29,11 +29,11 @@ export default function switchMix(art, player) {
const { playing } = player;
return player.attachUrl(url).then(() => {
option.url = url;
player.playbackRateRemove();
player.aspectRatioRemove();
player.playbackRate = false;
player.aspectRatio = false;
player.currentTime = 0;
if (playing) {
player.play();
player.play = true;
}
notice.show(`${i18n.get('Switch video')}: ${name}`);
art.emit('switch', url);