mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
优化事件互斥关系
This commit is contained in:
1 parent
cf22fb0535
commit
634e776d49
8 files changed
+41
-27
No files matched your search
@@ -0,0 +1,17 @@
|
||||
export default function exclusiveInit(art, player) {
|
||||
const props = ['pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate'];
|
||||
props.forEach((name) => {
|
||||
const event = `${name}Change`;
|
||||
art.on(event, (state) => {
|
||||
if (state) {
|
||||
props
|
||||
.filter((item) => item !== name)
|
||||
.forEach((item) => {
|
||||
if (player[item]) {
|
||||
player[item] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user