add rotateMix

This commit is contained in:
Harvey committed 2020-09-15 14:21:49 +08:00
1 parent 605771bea8
commit abf60cfef6
5 files changed
+38 -16

No files matched your search

+2
View File
@@ -26,6 +26,7 @@ import flipMix from './flipMix';
import lightMix from './lightMix';
import miniMix from './miniMix';
import loopMin from './loopMin';
import rotateMix from './rotateMix';
import { proxyPropertys } from '../utils';
export default class Player {
@@ -58,6 +59,7 @@ export default class Player {
lightMix(art, this);
miniMix(art, this);
loopMin(art, this);
rotateMix(art, this);
proxyPropertys(art, this);
}
}
@@ -0,0 +1,7 @@
import { def } from '../utils';
export default function rotateMix(art, player) {
def(player, 'rotate', {
get: () => 'rotate',
});
}
+7 -5
View File
@@ -8,14 +8,16 @@ export default function switchMix(art, player) {
URL.revokeObjectURL(player.url);
const { playing } = player;
player.url = url;
player.playbackRate = false;
player.aspectRatio = false;
art.once('video:canplay', () => {
player.playbackRate = false;
player.aspectRatio = false;
player.flip = 'normal';
player.autoSize = true;
player.currentTime = currentTime;
if (playing) {
player.play = true;
}
});
if (playing) {
player.play = true;
}
if (name) {
notice.show = `${i18n.get('Switch video')}: ${name}`;
}