//
//  ERTCVideoSettingCell.m
//  ERTCDemo
//
//  Created by wangjinlong23 on 2022/10/22.
//

#import "ERTCVideoSettingCell.h"
#import "EZConfGlobalConfig.h"

@interface ERTCVideoSettingCell()
@property (weak, nonatomic) IBOutlet UITextField *fpsTextField;
@property (weak, nonatomic) IBOutlet UILabel *resolutionLabel;
@property (weak, nonatomic) IBOutlet UILabel *videoBitrateLable;

@end

@implementation ERTCVideoSettingCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.fpsTextField addTarget:self action:@selector(fpsTextFieldTextChange:) forControlEvents:UIControlEventEditingChanged];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

+(NSString *)cellReuseId {
    return @"ERTCVideoSettingCell";
}

+(CGFloat)heightForCell {
    return 170;
}

- (void)setData:(ERTCVideoSettingtModel *)model {
    self.settingData = model;
    self.fpsTextField.text = [NSString stringWithFormat:@"%lu",(unsigned long)model.fps];
    self.resolutionLabel.text = [EZConfGlobalConfig desForRes:model.resolution];
    self.videoBitrateLable.text = [NSString stringWithFormat:@"%lu",(unsigned long)model.videoBitrate];
}

-(void)fpsTextFieldTextChange:(UITextField *)textField{
    NSLog(@"textField - 输入框内容改变,当前内容为: %@",textField.text);
    self.settingData.fps = [textField.text intValue];
}


@end
