//
//  OffcnLiveSDK.h
//  OffcnLiveSDK
//
//  Created by vockey on 2018/10/16.
//  Copyright © 2018年 中公教育. All rights reserved.
//

#import <UIKit/UIKit.h>
//#import "OffcnShareWindow.h"

static const NSString *OffcnLiveSDKVersion = @"此版本为瘟疫版本不可用";

@interface OffcnPlaybackModel : NSObject
//口令
@property (nonatomic, copy) NSString *password;
//是否在线播放
@property (nonatomic, assign) BOOL isOnline;
//当前播放时间
@property (nonatomic, assign) NSInteger currentSeconds;
//视频总时长
@property (nonatomic, assign) NSInteger totalSeconds;
@end

typedef NS_ENUM(NSUInteger, OffcnVideoType) {
    OffcnVideoTypeBigClassLive = 1,       //大班课直播
    OffcnVideoTypeBigClassPlayback,       //大班课回放
    OffcnVideoTypeSmallClassLive,         //小班课直播
    OffcnVideoTypeSmallClassPlayback,     //小班课回放
};

typedef NS_ENUM(NSUInteger, OffcnJumpMode) {
    OffcnJumpModePush = 0,
    OffcnJumpModePresent,
};

//直播间退出房间后回调
typedef void(^liveQuitCallBack)(NSString *password);

/**
回放观看进度退出房间后回调

@param password 课程口令
@param recentlyWatchValue 最近观看的秒数
@param maxWatchValue 最大观看的进度（最大观看的秒数/总时长秒数所得值）
@param totalValue 总时长秒数
*/
typedef void(^playbackCallBack)(NSString *password, NSInteger recentlyWatchValue, CGFloat maxWatchValue, NSInteger totalValue);


@interface OffcnLiveSDK : NSObject

/**
 创建直播单例服务

 @return 返回单例对象
 */
+ (OffcnLiveSDK *)defaultService;

/**
 共享窗口
 */
//@property (nonatomic,strong) OffcnShareWindow *shareWindow;

/**
 是否支持全屏
 */
@property (nonatomic, assign) BOOL isFull;

@property (nonatomic, assign) OffcnVideoType videoType;
/**
 是否选用测试环境
 */
@property (nonatomic, assign) BOOL isTest;

//直播间退出房间后回调
@property (nonatomic, copy) liveQuitCallBack offcnLiveQuitCallBack;

//回放观看进度退出房间后回调
@property (nonatomic, copy) playbackCallBack offcnPlaybackCallBack;

//回放观看过程中进度model(只在观看过程中有数据，退出房间后就被清空了)
@property (nonatomic, strong) OffcnPlaybackModel *playbackModel;

/**
 使用RealReachability监听网络状态上传用户观看进度统计数据和获取敏感词
 */
-(void)startNotifierUseRealReachability;

/**
 登录授权

 @param navigationController 导航控制器
 @param videoType 观看模式是：大班课直播/大班课回放/小班课直播(注:小班课目前只传OffcnVideoTypeSmallClassLive)
 @param jumpMode 跳转方式：Push/Present(注:小班课只传OffcnJumpModePresent)
 @param nickname 昵称
 @param password 不同课程的学生口令
 @param uuid 用户唯一标识码
 @param hook 根据自己需求区分(直播，回放，下载)的鉴权，非必填
 @param documentPath 沙盒所有视频所在路径
 @param extensionDic 根据自己需求的拓展字段，非必填
 @param seekTime 回放开始的时间，单位：秒，默认从0秒开始，根据需求是否从上次观看记录的位置开始播放，如果没有上次观看记录的位置请传0
 */
-(void)authWithNavigationController:(UINavigationController *)navigationController
            VideoType:(OffcnVideoType)videoType
            jumpMode:(OffcnJumpMode)jumpMode
            nickname:(NSString *)nickname
            password:(NSString *)password
            uuid:(NSString *)uuid
            hook:(NSString *)hook
            documentPath:(NSString *)documentPath
            extensionDic:(NSDictionary *)extensionDic
            playbackSeekTime:(NSTimeInterval)seekTime;

-(void)authWithNavigationController:(UINavigationController *)navigationController
            VideoType:(OffcnVideoType)videoType
            jumpMode:(OffcnJumpMode)jumpMode
            nickname:(NSString *)nickname
            password:(NSString *)password
            uuid:(NSString *)uuid
            hook:(NSString *)hook
            documentPath:(NSString *)documentPath
            extensionDic:(NSDictionary *)extensionDic;

/**
 *  resignKeyWindow，并还原到上一次的keyWindow
 */
//- (void)recoverLastKeyWindow;

/**
 tab(聊天，提问板，资料)普通颜色
 */
-(OffcnLiveSDK *(^)(NSString *))tabNormalColor;

/**
 tab(聊天，提问板，资料)选中颜色
 */
-(OffcnLiveSDK *(^)(NSString *))tabSelectedColor;

/**
 聊天区域背景色（默认灰色）
 */
-(OffcnLiveSDK *(^)(NSString *))chatBgColor;

/**
 聊天区域用户名颜色
 */
-(OffcnLiveSDK *(^)(NSString *))chatNicknameColor;

/**
 发送窗背景色（默认白色）
 */
-(OffcnLiveSDK *(^)(NSString *))inputBgColor;

/**
 房间标题区域背景色（默认白色）
 */
-(OffcnLiveSDK *(^)(NSString *))roomInfoBgColor;

/**
 房间标题文字颜色
 */
-(OffcnLiveSDK *(^)(NSString *))roomInfoTitleColor;

/**
 在线人数颜色
 */
-(OffcnLiveSDK *(^)(NSString *))roomOnlineNumColor;

/**
 公众号、微博、QQ群文字颜色
 */
-(OffcnLiveSDK *(^)(NSString *))wbTitleColor;

/**
 “直播”标签的背景色
 */
-(OffcnLiveSDK *(^)(NSString *))liveLabelBgColor;

/**
 “直播”标签的字体颜色
 */
-(OffcnLiveSDK *(^)(NSString *))liveLabelTitleColor;
@end
