add posterMix

This commit is contained in:
Harvey committed 2021-11-01 09:21:14 +08:00
1 parent d5b4851a8f
commit ec97a5912e
9 files changed
+77 -55

No files matched your search

+2
View File
@@ -27,6 +27,7 @@ import lightMix from './lightMix';
import miniMix from './miniMix';
import loopMin from './loopMin';
import rotateMix from './rotateMix';
import posterMix from './posterMix';
import { proxyPropertys } from '../utils';
export default class Player {
@@ -60,6 +61,7 @@ export default class Player {
miniMix(art, this);
loopMin(art, this);
rotateMix(art, this);
posterMix(art, this);
proxyPropertys(art, this);
}
}
@@ -0,0 +1,16 @@
import { def, setStyle } from '../utils';
export default function posterMix(art, player) {
const {
option,
template: { $poster },
} = art;
def(player, 'poster', {
get: () => option.poster,
set(url) {
option.poster = url;
setStyle($poster, 'backgroundImage', `url(${url})`);
},
});
}