Skip to content

Commit 43477f1

Browse files
committed
优化视频全屏适配逻辑,调整中心位置计算
1 parent 6c4d656 commit 43477f1

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

DYYY.xm

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4489,15 +4489,6 @@ static BOOL DYYYIsLandscapeVideoBounds(CGSize size) {
44894489
return;
44904490
}
44914491
BOOL shouldAdjust = DYYYIsLandscapeVideoBounds(self.bounds.size);
4492-
if (!shouldAdjust) {
4493-
CGFloat width = self.bounds.size.width;
4494-
CGFloat height = self.bounds.size.height;
4495-
if (width > 0.0f && height > width) {
4496-
const CGFloat maxPortraitRatio = 1.5f;
4497-
CGFloat aspectRatio = height / width;
4498-
shouldAdjust = aspectRatio <= maxPortraitRatio;
4499-
}
4500-
}
45014492
if (!shouldAdjust) {
45024493
return;
45034494
}
@@ -7026,8 +7017,14 @@ static Class TagViewClass = nil;
70267017
if (DYYYGetBool(@"DYYYEnableFullScreen")) {
70277018
UIViewController *vc = [DYYYUtils firstAvailableViewControllerFromView:self];
70287019
Class pureModeVC = NSClassFromString(@"AWEFeedPlayControlImpl.PureModePageCellViewController");
7029-
if (vc && pureModeVC && [vc isKindOfClass:pureModeVC]) {
7020+
BOOL inPureMode = (vc && pureModeVC && [vc isKindOfClass:pureModeVC]);
7021+
if (inPureMode) {
70307022
center.y += gCurrentTabBarHeight * 0.5;
7023+
} else {
7024+
CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
7025+
if (center.y > screenHeight * 0.6) {
7026+
center.y += gCurrentTabBarHeight * 0.5;
7027+
}
70317028
}
70327029
}
70337030

0 commit comments

Comments
 (0)