mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 20:21:20 -08:00
31 lines
830 B
JavaScript
31 lines
830 B
JavaScript
import { def } from '../utils';
|
|
|
|
export default function exclusiveMix(art) {
|
|
const sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb'];
|
|
|
|
function exclusive(props) {
|
|
for (let index = 0; index < props.length; index++) {
|
|
const name = props[index];
|
|
art.on(name, () => {
|
|
if (art[name]) {
|
|
props
|
|
.filter((item) => item !== name)
|
|
.forEach((item) => {
|
|
if (art[item]) {
|
|
art[item] = false;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
exclusive(sizeProps);
|
|
|
|
def(art, 'normalSize', {
|
|
get() {
|
|
return sizeProps.every((name) => !art[name]);
|
|
},
|
|
});
|
|
}
|