Commit c11c31f374c50894a1d1f918114ca1ed5057f2b1
1 parent
3e3230de
推流活动Id加时间戳,加封面图
Showing
1 changed file
with
13 additions
and
3 deletions
LiveVideoCloud/LiveVideoCloud/Classes/Sections/LiveSections/Controller/LVCLiveViewController.m
| @@ -58,12 +58,15 @@ | @@ -58,12 +58,15 @@ | ||
| 58 | [self.view addSubview:self.filterView]; | 58 | [self.view addSubview:self.filterView]; |
| 59 | 59 | ||
| 60 | // 初始化推流 | 60 | // 初始化推流 |
| 61 | - NSString *activityId = [NSString stringWithFormat:@"%d%d%d%d%d",arc4random()%9,arc4random()%9,arc4random()%9,arc4random()%9,arc4random()%9]; | 61 | + NSInteger time = [[NSDate date] timeIntervalSince1970]; |
| 62 | + NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time]; | ||
| 63 | + NSString *random = [NSString stringWithFormat:@"%d%d%d%d%d",arc4random()%9,arc4random()%9,arc4random()%9,arc4random()%9,arc4random()%9]; | ||
| 64 | + NSString *activityId = [NSString stringWithFormat:@"%@%@",timeString,random]; | ||
| 62 | 65 | ||
| 63 | _kitCN = [[CNLiveGPUStreamerKit alloc] initWithDefaultConfigWithActivityId:activityId channelId:@"iOStest" isHorizontalScreen:@"0"]; | 66 | _kitCN = [[CNLiveGPUStreamerKit alloc] initWithDefaultConfigWithActivityId:activityId channelId:@"iOStest" isHorizontalScreen:@"0"]; |
| 64 | 67 | ||
| 65 | - // _kitCN.activityName = @"iOS test"; | ||
| 66 | - // _kitCN.coverImgUrl = @"djfiwooa"; | 68 | + _kitCN.coverImgUrl = @"https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=iphone%20%E5%A3%81%E7%BA%B8&hs=2&pn=13&spn=0&di=52551273060&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=3269891096%2C90190857&os=1806178307%2C2162025297&simid=4143581502%2C419653732&adpicid=0&lpn=0&ln=30&fr=ala&fm=&sme=&cg=&bdtype=0&oriquery=iphone%20%E5%A3%81%E7%BA%B8&objurl=http%3A%2F%2Fcdn.duitang.com%2Fuploads%2Fitem%2F201208%2F29%2F20120829103142_Vcaze.jpeg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3B17tpwg2_z%26e3Bv54AzdH3Fks52AzdH3F%3Ft1%3D0dd99dlc&gsm=0"; |
| 69 | + //https://image.baidu.com/search/detail?ct=503316480&z=0&ipn=d&word=iphone%20%E5%A3%81%E7%BA%B8&hs=2&pn=14&spn=0&di=182181494770&pi=0&rn=1&tn=baiduimagedetail&is=0%2C0&ie=utf-8&oe=utf-8&cl=2&lm=-1&cs=2925938329%2C2739345390&os=4042866750%2C3514767176&simid=3075515976%2C3560863567&adpicid=0&lpn=0&ln=30&fr=ala&fm=&sme=&cg=&bdtype=0&oriquery=iphone%20%E5%A3%81%E7%BA%B8&objurl=http%3A%2F%2Fimg4q.duitang.com%2Fuploads%2Fitem%2F201505%2F02%2F20150502012912_QFAeZ.jpeg&fromurl=ippr_z2C%24qAzdH3FAzdH3Fooo_z%26e3B17tpwg2_z%26e3Bv54AzdH3Frj5rsjAzdH3F4ks52AzdH3Fnma09a0m8AzdH3F1jpwtsAzdH3F&gsm=0 | ||
| 67 | 70 | ||
| 68 | // 设置推流配置 | 71 | // 设置推流配置 |
| 69 | [self setStreamerCfg]; | 72 | [self setStreamerCfg]; |
| @@ -122,6 +125,13 @@ | @@ -122,6 +125,13 @@ | ||
| 122 | #pragma mark - UIButton Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 125 | #pragma mark - UIButton Action !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 123 | - (void)startCapture:(UIButton *)button { // 开始推流 | 126 | - (void)startCapture:(UIButton *)button { // 开始推流 |
| 124 | 127 | ||
| 128 | + // 设置标题 | ||
| 129 | + if (_prepareView.titleTextField.text) { | ||
| 130 | + _kitCN.activityName = _prepareView.titleTextField.text; | ||
| 131 | + } else { | ||
| 132 | + _kitCN.activityName = @"无名"; | ||
| 133 | + } | ||
| 134 | + | ||
| 125 | [_quitButton removeFromSuperview]; | 135 | [_quitButton removeFromSuperview]; |
| 126 | [_openFilterButton removeFromSuperview]; | 136 | [_openFilterButton removeFromSuperview]; |
| 127 | [_changeCameraButton removeFromSuperview]; | 137 | [_changeCameraButton removeFromSuperview]; |