//
//  HeadNewsTVViewController.m
//  Open
//
//  Created by 雷俊博 on 2021/8/5.
//  Copyright © 2021 黄江涛 . All rights reserved.
//

#import "HeadNewsTVViewController.h"
#import <KSAdSDK/KSCUFeedPage.h>

@interface HeadNewsTVViewController ()<KSCUVideoStateDelegate,KSCUContentStateDelegate,KSCUFeedPageCallBackProtocol>
@property (nonatomic, strong) KSCUFeedPage *feedPage;

@end

@implementation HeadNewsTVViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self addTvSubVC];
}

- (void)addTvSubVC
{
    KSCUFeedPage *feedPage = [[KSCUFeedPage alloc] initWithPosId:@"6030000009"];

    feedPage.videoStateDelegate = self;
    feedPage.stateDelegate = self;
    feedPage.callBackDelegate = self;
    feedPage.hidesBottomBarWhenPushed = YES;

    self.feedPage = feedPage;
    UIViewController *vc1 = self.feedPage.feedViewController;

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


#pragma mark - KSCUVideoStateDelegate
/**
 * 视频开始播放
 * @param videoContent 内容模型
 */
- (void)kscu_videoDidStartPlay:(id<KSCUContentInfo>)videoContent
{
    
}
/**
* 视频暂停播放
* @param videoContent 内容模型
*/
- (void)kscu_videoDidPause:(id<KSCUContentInfo>)videoContent
{
    
}
/**
* 视频恢复播放
* @param videoContent 内容模型
*/
- (void)kscu_videoDidResume:(id<KSCUContentInfo>)videoContent
{
    
}
/**
* 视频停止播放
* @param videoContent 内容模型
* @param finished     是否播放完成
*/
- (void)kscu_videoDidEndPlay:(id<KSCUContentInfo>)videoContent isFinished:(BOOL)finished
{
    
}
/**
* 视频播放失败
* @param videoContent 内容模型
* @param error        失败原因
*/
- (void)kscu_videoDidFailedToPlay:(id<KSCUContentInfo>)videoContent withError:(NSError *)error
{
    
}

#pragma mark - KSCUContentStateDelegate
/**
* 内容展示
* @param content 内容模型
*/
- (void)kscu_contentDidFullDisplay:(id<KSCUContentInfo>)content
{
    
}
/**
* 内容隐藏
* @param content 内容模型
*/
- (void)kscu_contentDidEndDisplay:(id<KSCUContentInfo>)content
{
    
}
/**
* 内容暂停显示，ViewController disappear或者Application resign active
* @param content 内容模型
*/
- (void)kscu_contentDidPause:(id<KSCUContentInfo>)content
{
    
}
/**
* 内容恢复显示，ViewController appear或者Application become active
* @param content 内容模型
*/
- (void)kscu_contentDidResume:(id<KSCUContentInfo>)content
{
    
}

#pragma mark - KSCUFeedPageCallBackProtocol
/// 请求开始回调
- (void)kscuContentRequestStart:(KSCUFeedEvent *)event
{
    
}
/// 请求成功回调
- (void)kscuContentRequestSuccess:(KSCUFeedEvent *)event
                         callBack:(KSCUResponseObj *)responseObj
{
    
}
/// 请求开失败回调
- (void)kscuContentRequestFail:(KSCUFeedEvent *)event
{
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
