VideoHelperViewController.h 2.61 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
//
//  VideoHelperViewController.h
//  Lighting
//
//  Created by 曹云霄 on 2016/11/25.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

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

14 15 16 17

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

@optional
21 22 23 24 25

/**
 视频播放完成

 @param studyEntity 学习任务entity
26
 @param indexPath   学习任务下标
27
 */
28 29 30 31 32 33 34 35 36
- (void)videoPlayFinish:(CustomStudyEntity *)studyEntity withIndexPath:(NSIndexPath *)indexPath;


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

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

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

@end


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

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

55
@end
56 57 58 59 60 61 62 63

@interface VideoHelperViewController : BaseViewController


/**
 播放Layer
 */
@property (nonatomic,strong) AVPlayerLayer *playerLayer;
64 65 66 67 68
@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;
69
@property (nonatomic,weak) id<VideoPlayProgressDelegate> progressDelegate;
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90

/**
 视频导航栏
 */
@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;

91 92 93 94 95
/**
 缩放按钮
 */
@property (weak, nonatomic) IBOutlet UIButton *zoomButton;

96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
/**
 播放进度
 */
@property (weak, nonatomic) IBOutlet UIProgressView *bufferProgressView;

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

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

111 112 113 114 115
/**
 播放项下标
 */
@property (nonatomic,strong) NSIndexPath *indexPath;

116 117 118
/**
 播放路径
 */
119
@property (nonatomic,copy) CustomStudyEntity *learningItem;
120 121 122 123 124 125

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

126 127 128 129 130
/**
 重置播放器
 */
- (void)resetPlayer;

131 132 133 134 135 136 137
/**
 当前播放时间

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

138 139 140 141 142 143 144 145 146 147
/**
 播放
 */
- (void)startPlay;

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

148 149

@end