播放器ZFPlayer的使用之横竖屏播放切换

检查第一步


- (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];
        /// 后台是否继续播放
        _player.pauseWhenAppResignActive = NO;
        /// 是否支持旋转
//        _player.allowOrentitaionRotation = NO;
        /// 设置自定义容器
        _player.controlView = self.customView;
        
        //@zf_weakify(self)
        _player.orientationWillChange = ^(ZFPlayerController * _Nonnull player, BOOL isFullScreen) {
            ((AppDelegate *)[[UIApplication sharedApplication] delegate]).allowRotation = isFullScreen;
        };
    }
    return _player;
}

给个播放地址

    self.playerManager.assetURL = [NSURL URLWithString:model.vod_url];

=========

=========

VideoPlayCustomView 是我扩展的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; ///< 是否播放完成
/**
 设置标题、封面、全屏模式
 
 @param coverUrl 视频的封面,占位图默认是灰色的
 @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;///< 播放的当前时间
@property (nonatomic, strong) SliderView *slider;///< 滑杆
@property (nonatomic, strong) UILabel *totalTimeLabel;///< 视频总时间
//@property (nonatomic, strong) SliderView *bottomPgrogress;///< 底部播放进度
@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];
        
        // 设置子控件的响应事件
        [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(@"没在录制");
        }
    } 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];
//    }
} 

/// 根据当前播放状态取反
- (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;
}

/**
 设置标题、封面、全屏模式
 
 @param coverUrl 视频的封面,占位图默认是灰色的
 @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]];
}

/// 调节播放进度slider和当前时间更新
- (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);
    }];
}

/// 滑杆结束滑动
- (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

/// 手势筛选,返回NO不响应该手势
- (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];
}

/// 单击手势事件
- (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];
//    }
}

/// 双击手势事件
- (void)gestureDoubleTapped:(ZFPlayerGestureControl *)gestureControl
{
    if (!self.player) return;
    [self playOrPause];
}

/// 捏合手势事件,这里改变了视频的填充模式
- (void)gesturePinched:(ZFPlayerGestureControl *)gestureControl scale:(float)scale {
    if (scale > 1) {
        self.player.currentPlayerManager.scalingMode = ZFPlayerScalingModeAspectFill;
    } else {
        self.player.currentPlayerManager.scalingMode = ZFPlayerScalingModeAspectFit;
    }
}

/// 准备播放
- (void)videoPlayer:(ZFPlayerController *)videoPlayer prepareToPlay:(NSURL *)assetURL {
    
}

/// 播放状态改变
- (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state {
    if (state == ZFPlayerPlayStatePlaying) {
        [self playBtnSelectedState:YES];
    } else if (state == ZFPlayerPlayStatePaused) {
        [self playBtnSelectedState:NO];
    } else if (state == ZFPlayerPlayStatePlayFailed) {
    }
}

/// 加载状态改变
- (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 {
    }
}

/// 播放进度改变回调
- (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;
}

/// 缓冲改变回调
- (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即将旋转
- (void)videoPlayer:(ZFPlayerController *)videoPlayer orientationWillChange:(ZFOrientationObserver *)observer {}

/// 视频view已经旋转
- (void)videoPlayer:(ZFPlayerController *)videoPlayer orientationDidChanged:(ZFOrientationObserver *)observer {}

/// 锁定旋转方向
- (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

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,716评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,558评论 1 294
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,431评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,127评论 0 209
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,511评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,692评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,915评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,664评论 0 202
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,412评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,616评论 2 245
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,105评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,424评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,098评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,096评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,869评论 0 197
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,748评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,641评论 2 271

推荐阅读更多精彩内容