|
@ -13,6 +13,13 @@ static const CGFloat kVideoControlAnimationTimeinterval = 0.3;
|
13
|
13
|
static const CGFloat kVideoControlTimeLabelFontSize = 10.0;
|
14
|
14
|
static const CGFloat kVideoControlBarAutoFadeOutTimeinterval = 5.0;
|
15
|
15
|
|
|
16
|
#define IPHONE_X \
|
|
17
|
({BOOL isPhoneX = NO;\
|
|
18
|
if (@available(iOS 11.0, *)) {\
|
|
19
|
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
|
|
20
|
}\
|
|
21
|
(isPhoneX);})
|
|
22
|
|
16
|
23
|
@interface KRVideoPlayerControlView ()
|
17
|
24
|
|
18
|
25
|
@property (nonatomic, strong) UIView *topBar;
|
|
@ -57,7 +64,7 @@ static const CGFloat kVideoControlBarAutoFadeOutTimeinterval = 5.0;
|
57
|
64
|
- (void)layoutSubviews
|
58
|
65
|
{
|
59
|
66
|
[super layoutSubviews];
|
60
|
|
self.topBar.frame = CGRectMake(CGRectGetMinX(self.bounds), CGRectGetMinY(self.bounds), CGRectGetMaxX(self.bounds), kVideoControlBarHeight);
|
|
67
|
self.topBar.frame = CGRectMake(CGRectGetMinX(self.bounds), CGRectGetMinY(self.bounds) + (IPHONE_X?34:0), CGRectGetMaxX(self.bounds), kVideoControlBarHeight);
|
61
|
68
|
self.closeButton.frame = CGRectMake(CGRectGetMaxX(self.bounds) - CGRectGetMaxX(self.closeButton.bounds), CGRectGetMinX(self.bounds), CGRectGetMaxX(self.closeButton.bounds), CGRectGetMaxY(self.closeButton.bounds));
|
62
|
69
|
self.bottomBar.frame = CGRectMake(CGRectGetMinX(self.bounds), CGRectGetMaxY(self.bounds) - kVideoControlBarHeight, CGRectGetMaxX(self.bounds), kVideoControlBarHeight);
|
63
|
70
|
self.playButton.frame = CGRectMake(CGRectGetMinX(self.bottomBar.bounds), CGRectGetMaxY(self.bottomBar.bounds)/2 - CGRectGetMaxY(self.playButton.bounds)/2, CGRectGetMaxX(self.playButton.bounds), CGRectGetMaxY(self.playButton.bounds));
|