CNLiveViewController.m
2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//
// CNLiveViewController.m
// CNLivePlayer
//
// Created by 153993236@qq.com on 07/26/2019.
// Copyright (c) 2019 153993236@qq.com. All rights reserved.
//
#import "CNLiveViewController.h"
#import "CNLivePlayerController.h"
#import "CNLiveStreamerController.h"
@interface CNLiveViewController ()
@end
@implementation CNLiveViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
btn1.frame = CGRectMake(0, 0, 100, 50);
btn1.center = CGPointMake(self.view.center.x, self.view.center.y-50);
btn1.backgroundColor = [UIColor redColor];
[btn1 setTitle:@"播放" forState:UIControlStateNormal];
[btn1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[btn1 addTarget:self action:@selector(btnDidClicked1) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn1];
UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeCustom];
btn2.frame = CGRectMake(0, 0, 100, 50);
btn2.center = CGPointMake(self.view.center.x, self.view.center.y+50);
btn2.backgroundColor = [UIColor redColor];
[btn2 setTitle:@"推流" forState:UIControlStateNormal];
[btn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[btn2 addTarget:self action:@selector(btnDidClicked2) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn2];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetHeight([UIScreen mainScreen].bounds)-80, CGRectGetWidth(self.view.frame), 30)];
label.text = @"北京中投视讯文化传媒股份有限公司";
label.font = [UIFont systemFontOfSize:16];
label.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:label];
}
- (void)btnDidClicked1{
[self presentViewController:[CNLivePlayerController new] animated:YES completion:nil];
}
- (void)btnDidClicked2{
[self presentViewController:[CNLiveStreamerController new] animated:YES completion:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end