mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-16 09:36:16 -08:00
17 lines
503 B
JavaScript
17 lines
503 B
JavaScript
import { def } from '../utils';
|
|
|
|
export default function stateMix(art) {
|
|
const states = ['mini', 'pip', 'fullscreen', 'fullscreenWeb'];
|
|
def(art, 'state', {
|
|
get: () => states.find((name) => art[name]) || 'standard',
|
|
set(name) {
|
|
for (let index = 0; index < states.length; index++) {
|
|
const prop = states[index];
|
|
if (prop !== name && art[prop]) {
|
|
art[prop] = false;
|
|
}
|
|
}
|
|
},
|
|
});
|
|
}
|