檢查第一步
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window {
if (self.allowRotation) { // yes
//橫屏
// return UIInterfaceOrientationMaskLandscape;
return UIInterfaceOrientationMaskAllButUpsideDown;
} else { // no
//豎屏
return UIInterfaceOrientationMaskPortrait;
}
}
檢查第二步
/// VC中必須添加
- (BOOL)shouldAutorotate {
return NO;
}
檢查第三步
/// 如果不好用則copy VC中 加一下
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
if (self.player.isFullScreen) {
return UIInterfaceOrientationMaskLandscape;
}
return UIInterfaceOrientationMaskPortrait;
}
ZFPlayer
任子豐
QQ群: 123449304
首先pod
# 視頻播放器
pod 'ZFPlayer', '~> 4.0'
pod 'ZFPlayer/AVPlayer' , '~> 4.0'
其次引入頭文件
#import <ZFPlayer/ZFPlayer.h>
#import <ZFPlayer/ZFAVPlayerManager.h>
然后
@property (nonatomic, strong) ZFPlayerController *player;
@property (nonatomic, strong) ZFAVPlayerManager *playerManager;
@property (nonatomic, strong) VideoPlayCustomView *customView;
@property (nonatomic, strong) UIImageView *containerView;
懶加載
- (VideoPlayCustomView *)customView {
if (!_customView) {
_customView = [[VideoPlayCustomView alloc] init];
_customView.isTopHid = YES;
_customView.isFullScreenImg = NO;
}
return _customView;
}
- (UIImageView *)containerView {
if (!_containerView) {
_containerView = [UIImageView new];
_customView.clipsToBounds = YES;
_customView.contentMode = UIViewContentModeScaleAspectFill;
}
return _containerView;
}
- (ZFAVPlayerManager *)playerManager {
if (!_playerManager) {
_playerManager = [[ZFAVPlayerManager alloc] init];
}
return _playerManager;
}
- (ZFPlayerController *)player {
if (!_player) {
_player = [ZFPlayerController playerWithPlayerManager:self.playerManager containerView:self.containerView];
/// 后臺(tái)是否繼續(xù)播放
_player.pauseWhenAppResignActive = NO;
/// 是否支持旋轉(zhuǎn)
// _player.allowOrentitaionRotation = NO;
/// 設(shè)置自定義容器
_player.controlView = self.customView;
//@zf_weakify(self)
_player.orientationWillChange = ^(ZFPlayerController * _Nonnull player, BOOL isFullScreen) {
((AppDelegate *)[[UIApplication sharedApplication] delegate]).allowRotation = isFullScreen;
};
}
return _player;
}
給個(gè)播放地址
self.playerManager.assetURL = [NSURL URLWithString:model.vod_url];
=========
=========
VideoPlayCustomView 是我擴(kuò)展的view
.h
#import <ZFPlayer/ZFPlayerMediaControl.h>
typedef NS_ENUM(NSInteger, VideoPlayType) {
/// 錄制
VideoPlayType_Record = 0,
/// 廣告
VideoPlayType_Ad = 1
};
NS_ASSUME_NONNULL_BEGIN
@interface VideoPlayCustomView : UIView <ZFPlayerMediaControl>
@property (nonatomic, assign) VideoPlayType videoPlayType; ///< 兩種情況,因需求而定
@property (nonatomic, strong) VoidBlock gobackBlock;
@property (nonatomic, strong) VoidBlock deleVideoBlock;
@property (nonatomic, strong) BoolBlock fullScreenVideoBlock;
@property (nonatomic,assign) BOOL isplayEnd; ///< 是否播放完成
/**
設(shè)置標(biāo)題、封面、全屏模式
@param coverUrl 視頻的封面,占位圖默認(rèn)是灰色的
@param fullScreenMode 全屏模式
*/
- (void)showCoverURLString:(NSString *)coverUrl fullScreenMode:(ZFFullScreenMode)fullScreenMode;
@property (nonatomic, assign) BOOL isTopHid; ///< 頂部工具條是否隱藏
@property (nonatomic, assign) BOOL isBottomHid; ///< 底部工具條是否隱藏
@property (nonatomic, assign) BOOL isFullScreenImg; ///< 是否隱藏放大縮小按鈕
@end
.m
//
#import "VideoPlayCustomView.h"
#import <ZFPlayer/ZFPlayerController.h>
#import <ZFPlayer/ZFPlayerConst.h>
#import "SliderView.h"
@interface VideoPlayCustomView ()<SliderViewDelegate>
@property (nonatomic, strong) UIView *bottomToolView;///< 底部工具欄
@property (nonatomic, strong) UIView *topToolView;///< 頂部工具欄
@property (nonatomic, strong) UIButton *gobackBtn;///< 返回按鈕
@property (nonatomic, strong) UIButton *deleBtn;///< 刪除按鈕
@property (nonatomic, strong) UIButton *playOrPauseBtn;///< 播放或暫停按鈕
@property (nonatomic, strong) UIButton *fullScreenBtn;///< 滿屏
@property (nonatomic, strong) UILabel *currentTimeLabel;///< 播放的當(dāng)前時(shí)間
@property (nonatomic, strong) SliderView *slider;///< 滑桿
@property (nonatomic, strong) UILabel *totalTimeLabel;///< 視頻總時(shí)間
//@property (nonatomic, strong) SliderView *bottomPgrogress;///< 底部播放進(jìn)度
@property (nonatomic, assign) BOOL isSureCaptured; ///< 是否在錄屏
@property (nonatomic, assign) BOOL isClearScreen; ///< 是否清屏
@end
@implementation VideoPlayCustomView
@synthesize player = _player;
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.isClearScreen = NO;
// 添加子控件
[self addSubview:self.topToolView];
[self addSubview:self.bottomToolView];
[self.topToolView addSubview:self.gobackBtn];
[self.topToolView addSubview:self.deleBtn];
[self.bottomToolView addSubview:self.playOrPauseBtn];
[self.bottomToolView addSubview:self.currentTimeLabel];
[self.bottomToolView addSubview:self.slider];
[self.bottomToolView addSubview:self.totalTimeLabel];
// [self addSubview:self.bottomPgrogress];
[self.bottomToolView addSubview:self.fullScreenBtn];
// 設(shè)置子控件的響應(yīng)事件
[self makeSubViewsAction];
self.clipsToBounds = YES;
}
return self;
}
- (void)setVideoPlayType:(VideoPlayType)videoPlayType {
_videoPlayType = videoPlayType;
if (_videoPlayType == VideoPlayType_Record) {
self.deleBtn.hidden = YES;
}
else if (_videoPlayType == VideoPlayType_Ad) {
self.deleBtn.hidden = NO;
}
}
- (void)makeSubViewsAction {
[self.playOrPauseBtn addTarget:self action:@selector(playPauseButtonClickAction:) forControlEvents:UIControlEventTouchUpInside];
[self.fullScreenBtn addTarget:self action:@selector(fullScreenButtonClickAction:) forControlEvents:UIControlEventTouchUpInside];
}
/// 暫停視頻
- (void)pauseVideo {
self.playOrPauseBtn.selected = NO;
[self.player.currentPlayerManager pause];
}
/// 播放視頻
- (void)playVideo {
self.playOrPauseBtn.selected = YES;
[self.player.currentPlayerManager play];
}
/// 錄屏
- (void)isCaptured {
if (@available(iOS 11.0, *)) {
if ([UIScreen mainScreen].isCaptured && self.isSureCaptured == NO) {
self.isSureCaptured = YES;
[self pauseVideo];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"" message:@"不允許錄制" preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
self.isSureCaptured = NO;
}];
[alertController addAction:okAction];
[[ViewTool topViewController] presentViewController:alertController animated:YES completion:nil];
}
else {
// NSLog(@"沒(méi)在錄制");
}
} else {
// Fallback on earlier versions
}
}
#pragma mark - ZFSliderViewDelegate
- (void)sliderTouchBegan:(float)value {
self.slider.isdragging = YES;
}
- (void)sliderTouchEnded:(float)value {
if (self.player.totalTime > 0) {
[self.player seekToTime:self.player.totalTime*value completionHandler:^(BOOL finished) {
if (finished) {
self.slider.isdragging = NO;
}
}];
} else {
self.slider.isdragging = NO;
}
}
- (void)sliderValueChanged:(float)value {
if (self.player.totalTime == 0) {
self.slider.value = 0;
return;
}
self.slider.isdragging = YES;
NSString *currentTimeString = [self convertTimeSecond:self.player.totalTime*value];
self.currentTimeLabel.text = currentTimeString;
}
- (void)sliderTapped:(float)value {
if (self.player.totalTime > 0) {
self.slider.isdragging = YES;
[self.player seekToTime:self.player.totalTime*value completionHandler:^(BOOL finished) {
if (finished) {
self.slider.isdragging = NO;
[self.player.currentPlayerManager play];
}
}];
} else {
self.slider.isdragging = NO;
self.slider.value = 0;
}
}
#pragma mark - action
- (void)playPauseButtonClickAction:(UIButton *)sender {
[self playOrPause];
}
- (void)fullScreenButtonClickAction:(UIButton *)sender {
sender.selected = !sender.selected;
[self.player enterFullScreen:!self.player.isFullScreen animated:YES];
// [self pauseVideo];
// if (self.fullScreenVideoBlock) {
// self.fullScreenVideoBlock(sender);
// }
// if (!self.player) return;
// if (self.player.isSmallFloatViewShow && !self.player.isFullScreen) {
// [self.player enterFullScreen:!self.player.isFullScreen animated:YES];
// }
}
/// 根據(jù)當(dāng)前播放狀態(tài)取反
- (void)playOrPause {
if (self.isplayEnd) {
self.isplayEnd = NO;
[self.player.currentPlayerManager replay];
}
else {
self.playOrPauseBtn.selected = !self.playOrPauseBtn.isSelected;
self.playOrPauseBtn.isSelected? [self.player.currentPlayerManager play]: [self.player.currentPlayerManager pause];
}
}
- (void)playBtnSelectedState:(BOOL)selected {
self.playOrPauseBtn.selected = selected;
}
#pragma mark - 添加子控件約束
- (void)layoutSubviews {
[super layoutSubviews];
CGFloat min_x = 0;
CGFloat min_y = 0;
CGFloat min_w = 0;
CGFloat min_h = 0;
CGFloat min_view_w = self.bounds.size.width;
CGFloat min_view_h = self.bounds.size.height;
min_x = 0;
min_y = XPF_StatusBarHeight + RATIOA(8);
min_w = min_view_w;
min_h = RATIOA(26);
self.topToolView.frame = CGRectMake(min_x, min_y, min_w, min_h);
min_x = RATIOA(10);
min_y = 0;
min_w = RATIOA(26);
min_h = RATIOA(26);
self.gobackBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
min_x = SW - RATIOA(15) - RATIOA(48);
min_y = 0;
min_w = RATIOA(48);
min_h = RATIOA(26);
self.deleBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
self.deleBtn.centerY = self.gobackBtn.centerY;
min_h = RATIOA(40);
min_x = 0;
min_y = min_view_h - min_h;
min_w = min_view_w;
self.bottomToolView.frame = CGRectMake(min_x, min_y, min_w, min_h);
min_x = RATIOA(12);
min_w = RATIOA(20);
min_h = RATIOA(20);
min_y = RATIOA(8);
self.playOrPauseBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
min_x = RATIOA(43);
min_w = RATIOA(60);
min_h = RATIOA(13);
min_y = 0;
self.currentTimeLabel.frame = CGRectMake(min_x, min_y, min_w, min_h);
self.currentTimeLabel.centerY = self.playOrPauseBtn.centerY;
min_w = RATIOA(60);
min_h = RATIOA(13);
min_x = min_view_w - min_w - RATIOA(43);
min_y = 0;
self.totalTimeLabel.frame = CGRectMake(min_x, min_y, min_w, min_h);
self.totalTimeLabel.centerY = self.playOrPauseBtn.centerY;
min_x = self.currentTimeLabel.right + RATIOA(8);
min_w = self.totalTimeLabel.left - min_x - RATIOA(8);
min_h = 30;
min_y = 0;
self.slider.frame = CGRectMake(min_x, min_y, min_w, min_h);
self.slider.centerY = self.playOrPauseBtn.centerY;
// min_x = 0;
// min_y = min_view_h - 1;
// min_w = min_view_w;
// min_h = 1;
// self.bottomPgrogress.frame = CGRectMake(min_x, min_y, min_w, min_h);
min_x = self.totalTimeLabel.right + RATIOA(8);
min_y = RATIOA(8);
min_w = RATIOA(20);
min_h = RATIOA(20);
self.fullScreenBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
}
#pragma mark - 添加子控件約束
- (BOOL)shouldResponseGestureWithPoint:(CGPoint)point withGestureType:(ZFPlayerGestureType)type touch:(nonnull UITouch *)touch {
CGRect sliderRect = [self.bottomToolView convertRect:self.slider.frame toView:self];
if (CGRectContainsPoint(sliderRect, point)) {
return NO;
}
return YES;
}
/**
設(shè)置標(biāo)題、封面、全屏模式
@param coverUrl 視頻的封面,占位圖默認(rèn)是灰色的
@param fullScreenMode 全屏模式
*/
- (void)showCoverURLString:(NSString *)coverUrl fullScreenMode:(ZFFullScreenMode)fullScreenMode {
[self layoutIfNeeded];
[self setNeedsDisplay];
self.player.orientationObserver.fullScreenMode = fullScreenMode;
[self.player.currentPlayerManager.view.coverImageView sd_setImageWithURL:[NSURL URLWithString:coverUrl]];
}
/// 調(diào)節(jié)播放進(jìn)度slider和當(dāng)前時(shí)間更新
- (void)sliderValueChanged:(CGFloat)value currentTimeString:(NSString *)timeString {
self.slider.value = value;
self.currentTimeLabel.text = timeString;
self.slider.isdragging = YES;
[UIView animateWithDuration:0.3 animations:^{
self.slider.sliderBtn.transform = CGAffineTransformMakeScale(1.2, 1.2);
}];
}
/// 滑桿結(jié)束滑動(dòng)
- (void)sliderChangeEnded {
self.slider.isdragging = NO;
[UIView animateWithDuration:0.3 animations:^{
self.slider.sliderBtn.transform = CGAffineTransformIdentity;
}];
}
- (NSString *)convertTimeSecond:(NSInteger)timeSecond {
NSString *theLastTime = nil;
long second = timeSecond;
// theLastTime = [NSString stringWithFormat:@"%02zd:%02zd:%02zd", second/3600, second%3600/60, second%60];
if (timeSecond < 60) {
theLastTime = [NSString stringWithFormat:@"00:%02zd", second];
} else if(timeSecond >= 60 && timeSecond < 3600){
theLastTime = [NSString stringWithFormat:@"%02zd:%02zd", second/60, second%60];
} else if(timeSecond >= 3600){
theLastTime = [NSString stringWithFormat:@"%02zd:%02zd:%02zd", second/3600, second%3600/60, second%60];
}
return theLastTime;
}
#pragma mark - ZFPlayerControlViewDelegate
/// 手勢(shì)篩選,返回NO不響應(yīng)該手勢(shì)
- (BOOL)gestureTriggerCondition:(ZFPlayerGestureControl *)gestureControl gestureType:(ZFPlayerGestureType)gestureType gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer touch:(nonnull UITouch *)touch {
CGPoint point = [touch locationInView:self];
if (self.player.isSmallFloatViewShow && !self.player.isFullScreen && gestureType != ZFPlayerGestureTypeSingleTap) {
return NO;
}
return [self shouldResponseGestureWithPoint:point withGestureType:gestureType touch:touch];
}
/// 單擊手勢(shì)事件
- (void)gestureSingleTapped:(ZFPlayerGestureControl *)gestureControl
{
if (!self.player) return;
if (!self.isClearScreen)
{
self.isClearScreen = YES;
if (!self.isTopHid) {
self.topToolView.hidden = YES;
}
self.bottomToolView.hidden = YES;
}
else
{
self.isClearScreen = NO;
if (!self.isTopHid) {
self.topToolView.hidden = NO;
}
self.bottomToolView.hidden = NO;
}
// if (self.player.isSmallFloatViewShow && !self.player.isFullScreen) {
// [self.player enterFullScreen:YES animated:YES];
// }
}
/// 雙擊手勢(shì)事件
- (void)gestureDoubleTapped:(ZFPlayerGestureControl *)gestureControl
{
if (!self.player) return;
[self playOrPause];
}
/// 捏合手勢(shì)事件,這里改變了視頻的填充模式
- (void)gesturePinched:(ZFPlayerGestureControl *)gestureControl scale:(float)scale {
if (scale > 1) {
self.player.currentPlayerManager.scalingMode = ZFPlayerScalingModeAspectFill;
} else {
self.player.currentPlayerManager.scalingMode = ZFPlayerScalingModeAspectFit;
}
}
/// 準(zhǔn)備播放
- (void)videoPlayer:(ZFPlayerController *)videoPlayer prepareToPlay:(NSURL *)assetURL {
}
/// 播放狀態(tài)改變
- (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state {
if (state == ZFPlayerPlayStatePlaying) {
[self playBtnSelectedState:YES];
} else if (state == ZFPlayerPlayStatePaused) {
[self playBtnSelectedState:NO];
} else if (state == ZFPlayerPlayStatePlayFailed) {
}
}
/// 加載狀態(tài)改變
- (void)videoPlayer:(ZFPlayerController *)videoPlayer loadStateChanged:(ZFPlayerLoadState)state {
if (state == ZFPlayerLoadStatePrepare) {
} else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) {
self.player.currentPlayerManager.view.backgroundColor = [UIColor blackColor];
}
if (state == ZFPlayerLoadStateStalled && videoPlayer.currentPlayerManager.isPlaying) {
} else if ((state == ZFPlayerLoadStateStalled || state == ZFPlayerLoadStatePrepare) && videoPlayer.currentPlayerManager.isPlaying) {
} else {
}
}
/// 播放進(jìn)度改變回調(diào)
- (void)videoPlayer:(ZFPlayerController *)videoPlayer currentTime:(NSTimeInterval)currentTime totalTime:(NSTimeInterval)totalTime {
[self isCaptured];
if (!self.slider.isdragging) {
NSString *currentTimeString = [self convertTimeSecond:currentTime];
self.currentTimeLabel.text = currentTimeString;
NSString *totalTimeString = [self convertTimeSecond:totalTime];
self.totalTimeLabel.text = totalTimeString;
self.slider.value = videoPlayer.progress;
}
// self.bottomPgrogress.value = videoPlayer.progress;
}
/// 緩沖改變回調(diào)
- (void)videoPlayer:(ZFPlayerController *)videoPlayer bufferTime:(NSTimeInterval)bufferTime {
self.slider.bufferValue = videoPlayer.bufferProgress;
// self.bottomPgrogress.bufferValue = videoPlayer.bufferProgress;
}
- (void)videoPlayer:(ZFPlayerController *)videoPlayer presentationSizeChanged:(CGSize)size {}
/// 視頻view即將旋轉(zhuǎn)
- (void)videoPlayer:(ZFPlayerController *)videoPlayer orientationWillChange:(ZFOrientationObserver *)observer {}
/// 視頻view已經(jīng)旋轉(zhuǎn)
- (void)videoPlayer:(ZFPlayerController *)videoPlayer orientationDidChanged:(ZFOrientationObserver *)observer {}
/// 鎖定旋轉(zhuǎn)方向
- (void)lockedVideoPlayer:(ZFPlayerController *)videoPlayer lockedScreen:(BOOL)locked {}
#pragma mark - setter
- (void)setIsplayEnd:(BOOL)isplayEnd {
_isplayEnd = isplayEnd;
if (_isplayEnd == YES) {
self.playOrPauseBtn.selected = NO;
[self.playOrPauseBtn setImage:IMG(@"releaseVideo_refresh") forState:UIControlStateNormal];
}
else {
[self.playOrPauseBtn setImage:IMG(@"releaseVideo_suspend") forState:UIControlStateNormal];
}
}
- (void)setPlayer:(ZFPlayerController *)player {
_player = player;
}
#pragma mark - getter
#pragma mark - action
- (void)gobackClick {
if (self.gobackBlock) {
self.gobackBlock();
}
}
- (void)deleVideo {
if (self.deleVideoBlock) {
self.deleVideoBlock();
}
}
// MARK: ----- 頂部工具條是否隱藏
- (void)setIsTopHid:(BOOL)isTopHid
{
_isTopHid = isTopHid;
self.topToolView.hidden = isTopHid;
}
// MARK: ----- 底部工具條是否隱藏
- (void)setIsBottomHid:(BOOL)isBottomHid
{
_isBottomHid = isBottomHid;
self.bottomToolView.hidden = isBottomHid;
}
// MARK: ----- 是否隱藏放大縮小按鈕
- (void)setIsFullScreenImg:(BOOL)isFullScreenImg
{
_isFullScreenImg = isFullScreenImg;
self.fullScreenBtn.hidden = isFullScreenImg;
}
#pragma mark - lazy
- (UIView *)topToolView {
if (!_topToolView) {
_topToolView = [[UIView alloc] init];
_topToolView.backgroundColor = RGBA(0, 0, 0, 0);
}
return _topToolView;
}
- (UIButton *)gobackBtn {
if (!_gobackBtn) {
_gobackBtn = [[UIButton alloc] init];
[_gobackBtn setImage:IMG(@"releaseVideo_goback") forState:UIControlStateNormal];
[_gobackBtn addTarget:self action:@selector(gobackClick) forControlEvents:UIControlEventTouchUpInside];
}
return _gobackBtn;
}
- (UIButton *)deleBtn {
if (!_deleBtn) {
_deleBtn = [[UIButton alloc] init];
[_deleBtn setTitle:@"刪除" forState:UIControlStateNormal];
[_deleBtn setTitleColor:YGFFFFFF forState:UIControlStateNormal];
_deleBtn.backgroundColor = RGBA(0, 0, 0, 0.5);
_deleBtn.clipsToBounds = YES;
_deleBtn.layer.cornerRadius = RATIOA(5);
_deleBtn.titleLabel.font = FONT(15);
[_deleBtn addTarget:self action:@selector(deleVideo) forControlEvents:UIControlEventTouchUpInside];
}
return _deleBtn;
}
- (UIView *)bottomToolView {
if (!_bottomToolView) {
_bottomToolView = [[UIView alloc] init];
_bottomToolView.backgroundColor = RGBA(0, 0, 0, 0.5);
}
return _bottomToolView;
}
- (UIButton *)playOrPauseBtn {
if (!_playOrPauseBtn) {
_playOrPauseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_playOrPauseBtn setImage:IMG(@"releaseVideo_suspend") forState:UIControlStateNormal];
[_playOrPauseBtn setImage:IMG(@"releaseVideo_play") forState:UIControlStateSelected];
}
return _playOrPauseBtn;
}
- (UILabel *)currentTimeLabel {
if (!_currentTimeLabel) {
_currentTimeLabel = [[UILabel alloc] init];
_currentTimeLabel.textColor = [UIColor whiteColor];
_currentTimeLabel.font = FONT(14);
_currentTimeLabel.textAlignment = NSTextAlignmentCenter;
}
return _currentTimeLabel;
}
- (SliderView *)slider {
if (!_slider) {
_slider = [[SliderView alloc] init];
_slider.delegate = self;
_slider.maximumTrackTintColor = [UIColor whiteColor];
_slider.bufferTrackTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5];
_slider.minimumTrackTintColor = YGFFFFFF;
[_slider setThumbImage:IMG(@"releaseVideo_circle") forState:UIControlStateNormal];
_slider.sliderHeight = 2;
}
return _slider;
}
- (UILabel *)totalTimeLabel {
if (!_totalTimeLabel) {
_totalTimeLabel = [[UILabel alloc] init];
_totalTimeLabel.textColor = [UIColor whiteColor];
_totalTimeLabel.font = FONT(14);
_totalTimeLabel.textAlignment = NSTextAlignmentCenter;
}
return _totalTimeLabel;
}
//- (SliderView *)bottomPgrogress {
// if (!_bottomPgrogress) {
// _bottomPgrogress = [[SliderView alloc] init];
// _bottomPgrogress.maximumTrackTintColor = [UIColor clearColor];
// _bottomPgrogress.minimumTrackTintColor = [UIColor whiteColor];
// _bottomPgrogress.bufferTrackTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5];
// _bottomPgrogress.sliderHeight = 1;
// _bottomPgrogress.isHideSliderBlock = NO;
// }
// return _bottomPgrogress;
//}
- (UIButton *)fullScreenBtn
{
if (!_fullScreenBtn) {
_fullScreenBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_fullScreenBtn setImage:IMG(@"palyback_enlarge") forState:UIControlStateNormal];
[_fullScreenBtn setImage:IMG(@"palyback_narrow") forState:UIControlStateSelected];
}
return _fullScreenBtn;
}
@end