GKDYVideoView.h 2.03 KB
//
//  GKDYVideoView.h
//  GKDYVideo
//
//  Created by QuintGao on 2018/9/23.
//  Copyright © 2018 QuintGao. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GKDYVideoControlView.h"
#import <NELivePlayerFramework/NELivePlayerController.h>

NS_ASSUME_NONNULL_BEGIN

#ifdef DEBUG
#define MYLog(FORMAT, ...) fprintf(stderr,"%s\n",[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
#else
#define MYLog(...)
#endif

@class GKDYVideoView;

@protocol GKDYVideoViewDelegate <NSObject>

@optional

- (void)videoView:(GKDYVideoView *)videoView didClickIcon:(ATRecord *)model;
- (void)videoView:(GKDYVideoView *)videoView didClickPraise:(ATRecord *)model;
- (void)videoView:(GKDYVideoView *)videoView didClickComment:(ATRecord *)model;
- (void)videoView:(GKDYVideoView *)videoView didClickShare:(ATRecord *)model;
- (void)videoView:(GKDYVideoView *)videoView didScrollIsCritical:(BOOL)isCritical;
- (void)videoView:(GKDYVideoView *)videoView didPanWithDistance:(CGFloat)distance isEnd:(BOOL)isEnd;

- (void)loadMoreData:(NSInteger)index;

- (void)indexChanged:(NSInteger)index;

- (void)startPlay: (UIView *)view url: (NSString *)url next: (NSArray *)nextUrls;

- (void)pausePlayer;

- (void)resumePlayer;

- (void)stopPlayer;

- (void)dismissPlayer;

- (void)removeVideo;

@end

@interface GKDYVideoView : UIView

@property (nonatomic, weak) id<GKDYVideoViewDelegate>   delegate;

@property (nonatomic, strong) ATRecord        *viewModel;

@property (nonatomic, strong) UIButton                  *backBtn;

// 当前播放内容的视图
@property (nonatomic, strong) GKDYVideoControlView      *currentPlayView;

// 当前播放内容的索引
@property (nonatomic, assign) NSInteger                 currentPlayIndex;

@property (nonatomic, weak) NELivePlayerController *netPlayer;

- (instancetype)initWithVC:(UIViewController *)vc isPushed:(BOOL)isPushed;

- (void)setModels:(NSArray *)models index:(NSInteger)index;

- (void)appendModels:(NSArray *)models;

- (void)pause;
- (void)resume;
- (void)destoryPlayer;

- (void)frontControl;

@end

NS_ASSUME_NONNULL_END