mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 12:11: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
@@ -1272,23 +1272,28 @@
|
||||
}
|
||||
|
||||
function exclusiveInit(art, player) {
|
||||
var props = ['mini', 'pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate'];
|
||||
props.forEach(function (name) {
|
||||
art.on(name, function (state) {
|
||||
if (state) {
|
||||
props.filter(function (item) {
|
||||
return item !== name;
|
||||
}).forEach(function (item) {
|
||||
if (player[item]) {
|
||||
player[item] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
var sizeProps = ['mini', 'pip', 'fullscreen', 'fullscreenWeb', 'fullscreenRotate'];
|
||||
|
||||
function exclusive(props) {
|
||||
props.forEach(function (name) {
|
||||
art.on(name, function () {
|
||||
if (player[name]) {
|
||||
props.filter(function (item) {
|
||||
return item !== name;
|
||||
}).forEach(function (item) {
|
||||
if (player[item]) {
|
||||
player[item] = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
def(player, 'normal', {
|
||||
}
|
||||
|
||||
exclusive(sizeProps);
|
||||
def(player, 'normalSize', {
|
||||
get: function get() {
|
||||
return props.every(function (name) {
|
||||
return sizeProps.every(function (name) {
|
||||
return !player[name];
|
||||
});
|
||||
}
|
||||
@@ -3740,7 +3745,7 @@
|
||||
var option = art.option,
|
||||
player = art.player;
|
||||
var resizeFn = throttle(function () {
|
||||
if (player.normal) {
|
||||
if (player.normalSize) {
|
||||
player.autoSize = option.autoSize;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user