mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
normal -> normalSize
This commit is contained in:
1 parent
7e4420d841
commit
86980b2a73
4 files changed
+42
-33
No files matched your search
@@ -4,7 +4,7 @@ export default function resizeInit(art, events) {
|
||||
const { option, player } = art;
|
||||
|
||||
const resizeFn = throttle(() => {
|
||||
if (player.normal) {
|
||||
if (player.normalSize) {
|
||||
player.autoSize = option.autoSize;
|
||||
}
|
||||
player.aspectRatioReset = true;
|
||||
|
||||
@@ -1,25 +1,29 @@
|
||||
import { def } from '../utils';
|
||||
|
||||
export default function exclusiveInit(art, player) {
|
||||
const props = ['mini', 'pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate'];
|
||||
const sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate'];
|
||||
|
||||
props.forEach((name) => {
|
||||
art.on(name, (state) => {
|
||||
if (state) {
|
||||
props
|
||||
.filter((item) => item !== name)
|
||||
.forEach((item) => {
|
||||
if (player[item]) {
|
||||
player[item] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function exclusive(props) {
|
||||
props.forEach((name) => {
|
||||
art.on(name, () => {
|
||||
if (player[name]) {
|
||||
props
|
||||
.filter((item) => item !== name)
|
||||
.forEach((item) => {
|
||||
if (player[item]) {
|
||||
player[item] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
def(player, 'normal', {
|
||||
exclusive(sizeProps);
|
||||
|
||||
def(player, 'normalSize', {
|
||||
get() {
|
||||
return props.every((name) => !player[name]);
|
||||
return sizeProps.every((name) => !player[name]);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user