...
|
...
|
@@ -168,31 +168,22 @@ |
|
|
|
|
|
- (void)continueRTMP {
|
|
|
if (_currentChannel) {
|
|
|
[[YH_NetworkAdapter adapter] setStatusWithStat:PushStatusStart andRoomId:_currentChannel.room completion:^(BOOL flag, NSError *error) {
|
|
|
if ([self startRtmp]) {
|
|
|
[YH_Tool alertMessage:@"直播开始"];
|
|
|
_totalTime = _currentChannel.totalTime.integerValue;
|
|
|
_timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateInfoView) userInfo:nil repeats:YES];
|
|
|
[_timer fire];
|
|
|
[self clearLog];
|
|
|
self.socketService.room = _currentChannel.room;
|
|
|
self.socketService.uid = @"";
|
|
|
self.socketService.userName = @"";
|
|
|
[self.socketService connect];
|
|
|
|
|
|
if (error) {
|
|
|
[self toastTip:[NSString stringWithFormat:@"开始失败,原因:%@",error.localizedDescription]];
|
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kPushging];
|
|
|
_currentChannel = nil;
|
|
|
}else {
|
|
|
if ([self startRtmp]) {
|
|
|
[YH_Tool alertMessage:@"直播开始"];
|
|
|
_totalTime = _currentChannel.totalTime.integerValue;
|
|
|
_timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateInfoView) userInfo:nil repeats:YES];
|
|
|
[_timer fire];
|
|
|
[self clearLog];
|
|
|
self.socketService.room = _currentChannel.room;
|
|
|
self.socketService.uid = @"";
|
|
|
self.socketService.userName = @"";
|
|
|
[self.socketService connect];
|
|
|
|
|
|
} else {
|
|
|
[self toastTip:@"直播开始失败"];
|
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kPushging];
|
|
|
_currentChannel = nil;
|
|
|
}
|
|
|
}
|
|
|
}];
|
|
|
} else {
|
|
|
[self toastTip:@"直播开始失败"];
|
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:kPushging];
|
|
|
_currentChannel = nil;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|