|
@@ -153,6 +153,8 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
|
|
|
@property (nonatomic, copy) LiveRoomBackAction callback;
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL needPublishStream;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
|
|
@@ -496,8 +498,13 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
|
|
|
- (void)appBecomeActive {
|
|
|
if (self.isEnterBackground && self.pageType == LIVEPAGE_LIVE && self.isOtherLogin == NO) {
|
|
|
- // 开启推流
|
|
|
- [self startPublishStream];
|
|
|
+ if ([USER_MANAGER checkIMConnected]) {
|
|
|
+ // 开启推流
|
|
|
+ [self startPublishStream];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.needPublishStream = YES;
|
|
|
+ }
|
|
|
}
|
|
|
self.isEnterBackground = NO;
|
|
|
}
|
|
@@ -653,6 +660,9 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
|
|
|
}];
|
|
|
}
|
|
|
+ if (self.needPublishStream) {
|
|
|
+ [self startPublishStream];
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -1003,7 +1013,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
MJWeakSelf;
|
|
|
[self.room.localUser publishDefaultLiveStreams:^(BOOL isSuccess, RCRTCCode code, RCRTCLiveInfo * _Nullable liveInfo) {
|
|
|
if (code == RCRTCCodeSuccess) {
|
|
|
-
|
|
|
+ weakSelf.needPublishStream = NO;
|
|
|
}
|
|
|
else {
|
|
|
[weakSelf MBPShow:@"视频流发布失败"];
|
|
@@ -1602,6 +1612,7 @@ typedef NS_ENUM(NSInteger, LIVEPAGE) {
|
|
|
}];
|
|
|
}
|
|
|
- (void)pauseLiveActionBack:(BOOL)backPreView {
|
|
|
+ self.needPublishStream = NO;
|
|
|
KSRCPauseLiveMessage *pauseMsg = [[KSRCPauseLiveMessage alloc] init];
|
|
|
MJWeakSelf;
|
|
|
[self sendMessage:pauseMsg displayMessage:NO callback:^(BOOL success) {
|