//
//  ERTCPlayerView.h
//  ERTCDemo
//
//  Created by wangjinlong23 on 2022/5/13.
//

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

NS_ASSUME_NONNULL_BEGIN

@protocol VCS_PlayerViewDelegate <NSObject>

 @optional  /** 采集代理输出 点击与数据 */
- (void)play_exitMeeting;
- (void)play_doubleStreamPushBtnClick;
- (void)play_membersManager;
- (void)play_beautySetting;
- (void)play_setting;
@end

@class ERTCVideoMeetingViewController;
@class ERTCVideoMeetingTopView;
@class ERTCVideoMeetingBottomView;
@class ERTCVideoRemoteView;
@class ERTCVideoChatMsgEditView;
@class ERTCVideoRemoteShareView;
@class ERTCUserInfo;
@interface ERTCPlayerView : UIView

/** 外部代理 */
@property (nonatomic, weak) id<VCS_PlayerViewDelegate> userDelegate;

@property (nonatomic, assign) CGFloat safeAreaInsetsTop;
@property (nonatomic, assign) CGFloat safeAreaInsetsBottom;
@property (nonatomic, assign) BOOL isToLand; //是否是横屏

@property (nonatomic, strong,nullable) ERTCVideoMeetingMinePlayerView *minePlayerView;
@property (nonatomic, strong) ERTCVideoMeetingTopView *topView;
@property (nonatomic, strong) ERTCVideoMeetingBottomView *bottomView;
@property (nonatomic, strong) ERTCVideoRemoteView *remoteView;
@property (nonatomic, strong) ERTCVideoRemoteShareView *remoteShareView;
@property (nonatomic, strong) ERTCVideoChatMsgEditView *msgEditView;
@property (nonatomic, strong) UIButton *msgSendBtn;
@property (nonatomic, strong) ERTCUserInfo *mineModel;
@property (nonatomic, copy) NSString *roomId;
@property (nonatomic, weak) ERTCVideoMeetingViewController *superViewController;

/*初始化**/
+ (instancetype)initWithAction_VCS_PlayerView;
///进入房间
- (void)enterRoomWithRoomId:(NSString *)roomId userId:(NSString *)userId completionBlock:(void (^)(NSError *error))completion;
///离开房间
-(void)exitMeeting;
///进入房间设置默认参数
- (void)setDefaultParam;
///展示屏幕共享
- (void)showRemoteShare:(NSString *)userId avaliable:(BOOL)avaliable;
///更新音量大小
- (void)updateVolume:(NSArray<ERTCVolumeInfo *> *)userVolumes;
#pragma mark - UIViewController Life Cycle
-(void)viewSafeAreaInsetsDidChange;

-(void)viewWillTransitionToSize:(CGSize)size;

-(void)viewWillAppear:(BOOL)animated;
-(void)viewWillDisappear:(BOOL)animated;
- (void)viewDidAppear:(BOOL)animated;
//-(void)tapView:(UIGestureRecognizer *)tapGes;

//远端用户进入房间
-(void)onMemberEnterRoom:(ERTCUserInfo *)notifyModel;
//远端用户退出房间
-(void)onMemberExitRoom:(ERTCUserInfo *)notifyModel;
//更新远端用户状态信息(视频、音频、音量大小)
-(void)onMemberInfoUpdate:(ERTCUserInfo *)notifyModel;
//更新本地用户状态信息(麦克风、摄像头状态)
-(void)updateMeetingMemberViewInfo:(ERTCUserInfo *)notifyModel;
//用户本地和远端用户网络状态信息
- (void)updateNetworkQuality:(ERTCUserInfo *)notifyModel;
//远端用户解码回调
- (void)onDisplay:(ERTCUserInfo *)notifyModel;
@end

NS_ASSUME_NONNULL_END
