mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 01:21:20 -08:00
add posterMix
This commit is contained in:
1 parent
d5b4851a8f
commit
ec97a5912e
9 files changed
+77
-55
No files matched your search
@@ -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})`);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user