//
//  FindSketchContentCell.m
//  Open
//
//  Created by qinxuyang on 2022/2/9.
//  Copyright © 2022 QXY. All rights reserved.
//

#import "FindSketchContentCell.h"

@interface FindSketchContentCell ()<UIGestureRecognizerDelegate>

@property (nonatomic, strong)UIViewController *vc1;
@end
@implementation FindSketchContentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

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

    // Configure the view for the selected state
}
- (void)setupVideoVCWithSelf:(UIViewController *)vc
{

    if (self.tubePage) {
        [self.tubePage.viewController removeFromParentViewController];
        self.tubePage = nil;
    }
//    KSCUTubeColorConfig *colorConfig = [[KSCUTubeColorConfig alloc] init];
//    colorConfig.backgroundColor = [UIColor redColor];
//    colorConfig.titleColor = [UIColor whiteColor];
//    colorConfig.subTitleColor = [UIColor colorWithWhite:0.8 alpha:1];
//    colorConfig.descriptionColor = [UIColor colorWithWhite:0.8 alpha:1];
    KSCUTubePage *tubePage = [[KSCUTubePage alloc] initWithPosId:@"4000000599" configBuilder:^(KSCUTubePageConfig * _Nonnull config) {
        config.stateDelegate = vc;
        config.videoStateDelegate = vc;
        config.callBackDelegate = vc;
//        config.showNavigation = YES;
    }];
    self.tubePage = tubePage;
    [tubePage setColorMode:KSCUTubeColorModeNormalMode colorConfig:nil];
    UIViewController *vc1 = self.tubePage.viewController;

//    [vc1 setKscu_feedPageDelegate:vc];
    [vc addChildViewController:vc1];
    [self.contentView addSubview:vc1.view];
    [vc1.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.right.bottom.left.offset(0);
    }];
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{

    return YES;
}
@end
