Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
renzifeng committed Mar 10, 2016
1 parent 70ee0fc commit 561d636
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Binary file modified .DS_Store
Binary file not shown.
22 changes: 13 additions & 9 deletions Player/PlayerView/ZFPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ - (void)layoutSubviews
{
[super layoutSubviews];
self.playerLayer.frame = self.bounds;

// 屏幕方向一发生变化就会调用这里
[UIApplication sharedApplication].statusBarHidden = NO;
self.isMaskShowing = NO;
// 延迟隐藏maskView
[self animateShow];
}

- (void)setVideoURL:(NSURL *)videoURL
Expand Down Expand Up @@ -177,8 +183,6 @@ - (void)setVideoURL:(NSURL *)videoURL
self.isLocalVideo = NO;
}

[UIApplication sharedApplication].statusBarHidden = NO;

// 初始化显示maskView为YES
self.isMaskShowing = YES;
// 延迟隐藏maskView
Expand Down Expand Up @@ -285,7 +289,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N

self.state = ZFPlayerStatePlaying;
// 加载完成后,再添加拖拽手势
// 添加平移手势,用来控制音量和快进快退
// 添加平移手势,用来控制音量、亮度、快进快退
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panDirection:)];
pan.delegate = self;
[self addGestureRecognizer:pan];
Expand Down Expand Up @@ -361,8 +365,8 @@ - (void)playerTimerAction
NSInteger durMin = (NSInteger)_playerItem.duration.value / _playerItem.duration.timescale / 60;//总秒
NSInteger durSec = (NSInteger)_playerItem.duration.value / _playerItem.duration.timescale % 60;//总分钟

self.maskView.currentTimeLabel.text = [NSString stringWithFormat:@"%02ld:%02ld", proMin, proSec];
self.maskView.totalTimeLabel.text = [NSString stringWithFormat:@"%02ld:%02ld", durMin, durSec];
self.maskView.currentTimeLabel.text = [NSString stringWithFormat:@"%02zd:%02zd", proMin, proSec];
self.maskView.totalTimeLabel.text = [NSString stringWithFormat:@"%02zd:%02zd", durMin, durSec];
}
}

Expand Down Expand Up @@ -470,8 +474,8 @@ - (void)progressSliderValueChanged:(UISlider *)slider
NSInteger durMin = (NSInteger)total / 60;//总秒
NSInteger durSec = (NSInteger)total % 60;//总分钟

NSString *currentTime = [NSString stringWithFormat:@"%02ld:%02ld", proMin, proSec];
NSString *totalTime = [NSString stringWithFormat:@"%02ld:%02ld", durMin, durSec];
NSString *currentTime = [NSString stringWithFormat:@"%02zd:%02zd", proMin, proSec];
NSString *totalTime = [NSString stringWithFormat:@"%02zd:%02zd", durMin, durSec];

self.maskView.currentTimeLabel.text = currentTime;
self.horizontalLabel.hidden = NO;
Expand Down Expand Up @@ -577,9 +581,9 @@ - (void)appDidEnterBackground
// 应用进入前台
- (void)appDidEnterPlayGround
{
self.isMaskShowing = YES;
self.isMaskShowing = NO;
// 延迟隐藏maskView
[self autoFadeOutControlBar];
[self animateShow];
if (!self.isPauseByUser) {
self.state = ZFPlayerStatePlaying;
self.maskView.startBtn.selected = YES;
Expand Down

0 comments on commit 561d636

Please sign in to comment.