VideoHelperViewController.h 2.61 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
//
//  VideoHelperViewController.h
//  Lighting
//
//  Created by 曹云霄 on 2016/11/25.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "BaseViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>
#import "VIMediaCache.h"


/**
 视频播放
 */
@protocol VideoPlayerDelegate <NSObject>

@optional

/**
 视频播放完成

 @param studyEntity 学习任务entity
 @param indexPath   学习任务下标
 */
- (void)videoPlayFinish:(CustomStudyEntity *)studyEntity withIndexPath:(NSIndexPath *)indexPath;


/**
 第一次播放或者PPT播放

 @param indexPath 下标
 */
- (void)isFirstPLayOrPPTPlay:(NSIndexPath *)indexPath;


@end


/**
 视频播放进度
 */
@protocol VideoPlayProgressDelegate <NSObject>

/**
 播放进度
 
 @param proportion 进度
 @param indexPath  index
 */
- (void)videoPlayProportion:(NSInteger)proportion withIndexPath:(NSIndexPath *)indexPath;

@end

@interface VideoHelperViewController : BaseViewController


/**
 播放Layer
 */
@property (nonatomic,strong) AVPlayerLayer *playerLayer;
@property (nonatomic,strong) AVPlayer *customPlayer;
@property (nonatomic,strong) AVPlayerItem *playerItem;
@property (nonatomic,strong) id avplayerServer;
@property (nonatomic,strong) VIResourceLoaderManager *resourceLoaderManager;
@property (nonatomic,weak) id<VideoPlayerDelegate> delegate;
@property (nonatomic,weak) id<VideoPlayProgressDelegate> progressDelegate;

/**
 视频导航栏
 */
@property (weak, nonatomic) IBOutlet UIView *videoNavigationView;

/**
 视频title
 */
@property (weak, nonatomic) IBOutlet UILabel *videoTitleLabel;

/**
 视频工具类
 */
@property (weak, nonatomic) IBOutlet UIView *videoToolView;

/**
 播放按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *playButton;

/**
 缩放按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *zoomButton;

/**
 播放进度
 */
@property (weak, nonatomic) IBOutlet UIProgressView *bufferProgressView;

/**
 当前播放时间
 */
@property (weak, nonatomic) IBOutlet UILabel *playingTimeLabel;

/**
 总时间
 */
@property (weak, nonatomic) IBOutlet UILabel *playItemTotalTimeLabel;

/**
 播放项下标
 */
@property (nonatomic,strong) NSIndexPath *indexPath;

/**
 播放路径
 */
@property (nonatomic,copy) CustomStudyEntity *learningItem;

/**
 放大缩小        boolValue(true 全屏)
 */
@property (nonatomic,copy) void(^zoomButtonClickBlock)(BOOL boolValue);

/**
 重置播放器
 */
- (void)resetPlayer;

/**
 当前播放时间

 @return 秒数
 */
- (double)getCurrentPlayingTime;

/**
 播放
 */
- (void)startPlay;

/**
 暂停
 */
- (void)stopPlay;


@end