|
@@ -85,9 +85,15 @@
|
|
#pragma mark 开始拉流
|
|
#pragma mark 开始拉流
|
|
- (void)beginWebRtcPlayFun
|
|
- (void)beginWebRtcPlayFun
|
|
{
|
|
{
|
|
|
|
+ if(_mediaStream){
|
|
|
|
+ //[_mediaStream disconnect];
|
|
|
|
+ //[_mediaStream removeFromSuperview];
|
|
|
|
+ //_mediaStream = nil;
|
|
|
|
+ }
|
|
_mediaStream = [[RTC_OBJC_TYPE(AMediaStream) alloc] initWithFrame:CGRectZero];
|
|
_mediaStream = [[RTC_OBJC_TYPE(AMediaStream) alloc] initWithFrame:CGRectZero];
|
|
[_mediaStream setEventDelegate:self];
|
|
[_mediaStream setEventDelegate:self];
|
|
[self.view addSubview:_mediaStream];
|
|
[self.view addSubview:_mediaStream];
|
|
|
|
+ HLog(@"_mediaStream:%@",_mediaStream)
|
|
|
|
|
|
[_mediaStream mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
[_mediaStream mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(0.f);
|
|
make.left.mas_equalTo(0.f);
|
|
@@ -168,19 +174,26 @@
|
|
[weakSelf showNewIndicatorWithCanBack:YES canTouch:NO];
|
|
[weakSelf showNewIndicatorWithCanBack:YES canTouch:NO];
|
|
|
|
|
|
//判断是否是全屏
|
|
//判断是否是全屏
|
|
- BOOL fullscreenType = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
|
|
|
|
- CGSize phoneSize = CGSizeMake(1080.0, 1920.0);
|
|
|
|
- if(fullscreenType){
|
|
|
|
- phoneSize = [RCCommandHelp commondToSetFullScreenPhoneSizeBySize];
|
|
|
|
- }
|
|
|
|
|
|
+// BOOL fullscreenType = [HWDataManager getBoolWithKey:Consn_player_full_screen_show];
|
|
|
|
+// CGSize phoneSize = CGSizeMake(1080.0, 1920.0);
|
|
|
|
+// if(fullscreenType){
|
|
|
|
+// phoneSize = [RCCommandHelp commondToSetFullScreenPhoneSizeBySize];
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// [weakSelf linkWebRtcFunWithSize:phoneSize];
|
|
|
|
|
|
- [weakSelf linkWebRtcFunWithSize:phoneSize];
|
|
|
|
|
|
+ [weakSelf beginWebRtcPlayFun];
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
#pragma mark 初始化其他UI
|
|
#pragma mark 初始化其他UI
|
|
- (void)initBaseUIFun
|
|
- (void)initBaseUIFun
|
|
{
|
|
{
|
|
|
|
+ if(_bottomContrView){
|
|
|
|
+ [_bottomContrView removeFromSuperview];
|
|
|
|
+ _bottomContrView = nil;
|
|
|
|
+ }
|
|
|
|
+
|
|
_bottomContrView = [[webRtcPlayerBottomContrView alloc] init];
|
|
_bottomContrView = [[webRtcPlayerBottomContrView alloc] init];
|
|
[self.view addSubview:_bottomContrView];
|
|
[self.view addSubview:_bottomContrView];
|
|
[self getPlayerBottomNavShowOrHidefun];
|
|
[self getPlayerBottomNavShowOrHidefun];
|
|
@@ -190,6 +203,10 @@
|
|
};
|
|
};
|
|
|
|
|
|
/*控制按钮*/
|
|
/*控制按钮*/
|
|
|
|
+ if(controlBtn){
|
|
|
|
+ [controlBtn removeFromSuperview];
|
|
|
|
+ controlBtn = nil;
|
|
|
|
+ }
|
|
UIImage *driftBtnImage = [UIImage imageNamed:@"you_icon"];
|
|
UIImage *driftBtnImage = [UIImage imageNamed:@"you_icon"];
|
|
controlBtn = [[UIButton alloc] init];
|
|
controlBtn = [[UIButton alloc] init];
|
|
[controlBtn setBackgroundColor:[UIColor clearColor]];
|
|
[controlBtn setBackgroundColor:[UIColor clearColor]];
|
|
@@ -344,6 +361,8 @@
|
|
[self pauseStream];
|
|
[self pauseStream];
|
|
|
|
|
|
[webRtcManager shareManager].isRebootIngType = YES;
|
|
[webRtcManager shareManager].isRebootIngType = YES;
|
|
|
|
+
|
|
|
|
+ [self showNewIndicatorWithCanBack:YES canTouch:NO];
|
|
}
|
|
}
|
|
|
|
|
|
#pragma mark X 秒后检查是否软件重启成功
|
|
#pragma mark X 秒后检查是否软件重启成功
|
|
@@ -749,6 +768,7 @@
|
|
-(void)onFrameResolutionChangedFromPeerName:(NSString*)peerName videoWidth:(int)videoWidth videoHeight:(int)videoHeight rotation:(int)rotation {
|
|
-(void)onFrameResolutionChangedFromPeerName:(NSString*)peerName videoWidth:(int)videoWidth videoHeight:(int)videoHeight rotation:(int)rotation {
|
|
HLog(@"推拉流 onFrameResolutionChangedFromPeerName:%@---%d---%d--%d",peerName,videoWidth,videoHeight,rotation)
|
|
HLog(@"推拉流 onFrameResolutionChangedFromPeerName:%@---%d---%d--%d",peerName,videoWidth,videoHeight,rotation)
|
|
|
|
|
|
|
|
+ HLog(@"ok _mediaStream:%@",_mediaStream)
|
|
mainBlock(^{
|
|
mainBlock(^{
|
|
[self handlUIAfterGetCloudPhoneVideoWidth:videoWidth videoHeight:videoHeight rotation:rotation];
|
|
[self handlUIAfterGetCloudPhoneVideoWidth:videoWidth videoHeight:videoHeight rotation:rotation];
|
|
});
|
|
});
|