diff --git a/Podfile b/Podfile index ada23995..d3772c62 100644 --- a/Podfile +++ b/Podfile @@ -5,7 +5,7 @@ target 'PolyvLiveScenesDemo' do use_frameworks! # 保利威 多场景 SDK - pod 'PLVLiveScenesSDK', '1.7.0' + pod 'PLVLiveScenesSDK', '1.7.2' # 保利威 UI源码 需依赖的库 pod 'SDWebImage', '4.4.0' diff --git a/PolyvLiveScenesDemo.xcodeproj/project.pbxproj b/PolyvLiveScenesDemo.xcodeproj/project.pbxproj index 2f3cef2c..551d9d2a 100644 --- a/PolyvLiveScenesDemo.xcodeproj/project.pbxproj +++ b/PolyvLiveScenesDemo.xcodeproj/project.pbxproj @@ -536,7 +536,6 @@ 21795DDD26077D7A001E3668 /* PLVLSSendMessageToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = 21795DDC26077D7A001E3668 /* PLVLSSendMessageToolView.m */; }; 2937E16E26E5CA5E002D3118 /* PLVLSDocumentWaitLiveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 296A1DA426CDF7FD0076A0CA /* PLVLSDocumentWaitLiveView.m */; }; 296A1DA526CDF7FE0076A0CA /* PLVLSDocumentWaitLiveView.m in Sources */ = {isa = PBXBuildFile; fileRef = 296A1DA426CDF7FD0076A0CA /* PLVLSDocumentWaitLiveView.m */; }; - 2EFE5B259B80F4A2D1C04A99 /* Pods_PolyvLiveScenesDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F620951BC17801D4F1DB13 /* Pods_PolyvLiveScenesDemo.framework */; }; 362D64A926D721270041FAE1 /* PLVHCLinkMicWindowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 362D64A826D721270041FAE1 /* PLVHCLinkMicWindowCell.m */; }; 362D64AA26D721270041FAE1 /* PLVHCLinkMicWindowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 362D64A826D721270041FAE1 /* PLVHCLinkMicWindowCell.m */; }; 362D659A26D784690041FAE1 /* PLVHCLinkMicWindowsView.m in Sources */ = {isa = PBXBuildFile; fileRef = 362D659926D784690041FAE1 /* PLVHCLinkMicWindowsView.m */; }; @@ -922,6 +921,7 @@ 8FFC704F26F200A900ED8C28 /* PLVHCAreaCodeChooseTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FFC704D26F200A900ED8C28 /* PLVHCAreaCodeChooseTableViewCell.m */; }; 8FFC705226F200B300ED8C28 /* PLVHCAreaCodeChooseView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FFC705026F200B200ED8C28 /* PLVHCAreaCodeChooseView.m */; }; 8FFC705326F200B300ED8C28 /* PLVHCAreaCodeChooseView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8FFC705026F200B200ED8C28 /* PLVHCAreaCodeChooseView.m */; }; + 9E8AC3A5FF0A3E7238FF1066 /* Pods_PolyvLiveScenesDemo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E66B007443EAEB85D1363DBC /* Pods_PolyvLiveScenesDemo.framework */; }; BF574404255D204500283C2D /* PLVECNewMessageView.m in Sources */ = {isa = PBXBuildFile; fileRef = BF574403255D204500283C2D /* PLVECNewMessageView.m */; }; BF7CFC6125BA636B0084C160 /* PLVECCommodityCell.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7CFC5725BA636B0084C160 /* PLVECCommodityCell.m */; }; BF7CFC6225BA636B0084C160 /* PLVECGoodsDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BF7CFC5925BA636B0084C160 /* PLVECGoodsDetailViewController.m */; }; @@ -1263,7 +1263,6 @@ 04D97C9C26F469750075CAD8 /* PLVHCLoginCustomButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PLVHCLoginCustomButton.h; sourceTree = ""; }; 04D97C9D26F469750075CAD8 /* PLVHCLoginCustomButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PLVHCLoginCustomButton.m; sourceTree = ""; }; 077C2E48E28AD1CD7FC8C0E8 /* Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo.release.xcconfig"; path = "Target Support Files/Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo/Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo.release.xcconfig"; sourceTree = ""; }; - 19F620951BC17801D4F1DB13 /* Pods_PolyvLiveScenesDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PolyvLiveScenesDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 213639DB264C1C56004F66A7 /* plvlw_login_clear@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plvlw_login_clear@2x.png"; sourceTree = ""; }; 213639DC264C1C56004F66A7 /* plvlw_login_logo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plvlw_login_logo@2x.png"; sourceTree = ""; }; 213639DD264C1C56004F66A7 /* plvlw_login_logo@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "plvlw_login_logo@3x.png"; sourceTree = ""; }; @@ -1698,6 +1697,7 @@ C8C0B1BDBA08B5A1387EB520 /* Pods-PolyvLiveScenesDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PolyvLiveScenesDemo.release.xcconfig"; path = "Target Support Files/Pods-PolyvLiveScenesDemo/Pods-PolyvLiveScenesDemo.release.xcconfig"; sourceTree = ""; }; D12BFA48BFD11F80E5A2FAA5 /* Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo.debug.xcconfig"; path = "Target Support Files/Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo/Pods-business-liveScenes-liveScenesDemo-PolyvStreamerAloneDemo.debug.xcconfig"; sourceTree = ""; }; D9C6F1C98177E8003A3399A9 /* Pods-business-liveScenes-PolyvLiveStreamerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-business-liveScenes-PolyvLiveStreamerDemo.release.xcconfig"; path = "Target Support Files/Pods-business-liveScenes-PolyvLiveStreamerDemo/Pods-business-liveScenes-PolyvLiveStreamerDemo.release.xcconfig"; sourceTree = ""; }; + E66B007443EAEB85D1363DBC /* Pods_PolyvLiveScenesDemo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PolyvLiveScenesDemo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FE0ED85B45376486CC1BFE2E /* Pods-PolyvLiveScenesDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PolyvLiveScenesDemo.debug.xcconfig"; path = "Target Support Files/Pods-PolyvLiveScenesDemo/Pods-PolyvLiveScenesDemo.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1735,7 +1735,7 @@ buildActionMask = 2147483647; files = ( 633E425D257DCD710039D35D /* PLVLiveScenesSDK.framework in Frameworks */, - 2EFE5B259B80F4A2D1C04A99 /* Pods_PolyvLiveScenesDemo.framework in Frameworks */, + 9E8AC3A5FF0A3E7238FF1066 /* Pods_PolyvLiveScenesDemo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3781,7 +3781,7 @@ 670B80B424C54D8800D94478 /* PolyvFoundationSDK.framework */, 430C9CF57975329ADA06E5C9 /* Pods_PolyvLiveEcommerceDemoUITests.framework */, 6ED5072918A006C94EB83D86 /* Pods_business_liveScenes_liveScenesDemo_PolyvStreamerAloneDemo.framework */, - 19F620951BC17801D4F1DB13 /* Pods_PolyvLiveScenesDemo.framework */, + E66B007443EAEB85D1363DBC /* Pods_PolyvLiveScenesDemo.framework */, ); name = Frameworks; sourceTree = ""; diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatViewController.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatViewController.m index 823b6475..8eecd67c 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatViewController.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatViewController.m @@ -99,7 +99,9 @@ - (void)viewWillLayoutSubviews { [self.keyboardToolView updateTextViewAndButton]; } - [self refreshLikeButtonViewFrame]; + if (![self currentIsFullScreen]) { + [self refreshLikeButtonViewFrame]; + } } } @@ -234,8 +236,7 @@ - (void)removeObserver { } - (void)interfaceOrientationDidChange:(NSNotification *)notification { - BOOL fullScreen = [UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height; - if (!fullScreen) { + if (![self currentIsFullScreen]) { [self scrollsToBottom:NO]; } } @@ -311,6 +312,10 @@ - (void)presentAlertController:(NSString *)message { [PLVAlbumTool presentAlertController:message inViewController:self]; } +- (BOOL)currentIsFullScreen { + return [UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height; +} + #pragma mark - PLVRoomDataManagerProtocol - (void)roomDataManager_didLikeCountChanged:(NSUInteger)likeCount { diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatroomViewModel.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatroomViewModel.m index 0ab7a170..caa7898a 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatroomViewModel.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Chatroom/PLVLCChatroomViewModel.m @@ -189,27 +189,30 @@ - (BOOL)sendQuesstionMessage:(NSString *)content { - (BOOL)sendSpeakMessage:(NSString *)content { PLVChatModel *model = [self.presenter sendSpeakMessage:content]; - if (model) { + BOOL sendSuccess = model && ![PLVChatroomManager sharedManager].closeRoom; + if (sendSuccess) { [self addPublicChatModel:model]; [self cacheDanmu:@[model]]; } - return model != nil; + return sendSuccess; } - (BOOL)sendImageMessage:(UIImage *)image { PLVChatModel *model = [self.presenter sendImageMessage:image]; - if (model) { + BOOL sendSuccess = model && ![PLVChatroomManager sharedManager].closeRoom; + if (sendSuccess) { [self addPublicChatModel:model]; } - return model != nil; + return sendSuccess; } - (BOOL)sendImageEmotionId:(NSString *)imageId imageUrl:(NSString *)imageUrl { PLVChatModel *model = [self.presenter sendImageEmotionId:imageId imageUrl:imageUrl]; - if (model) { + BOOL sendSuccess = model && ![PLVChatroomManager sharedManager].closeRoom; + if (sendSuccess) { [self addPublicChatModel:model]; } - return model != nil; + return sendSuccess; } - (void)sendLike { diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/PLVLCLinkMicAreaView.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/PLVLCLinkMicAreaView.m index 58729e4d..e92bf2b8 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/PLVLCLinkMicAreaView.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/PLVLCLinkMicAreaView.m @@ -377,7 +377,8 @@ - (void)plvLinkMicPresenter:(PLVLinkMicPresenter *)presenter didMediaMuted:(BOOL /// 连麦管理器的处理状态 发生改变 - (void)plvLinkMicPresenter:(PLVLinkMicPresenter *)presenter operationInProgress:(BOOL)inProgress{ - [self.currentControlBar controlBarUserInteractionEnabled:!inProgress]; + [self.landscapeControlBar controlBarUserInteractionEnabled:!inProgress]; + [self.portraitControlBar controlBarUserInteractionEnabled:!inProgress]; } /// 连麦在线用户数组 发生变化 diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicLandscapeControlBar.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicLandscapeControlBar.m index ad26f47b..0d1f1af5 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicLandscapeControlBar.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicLandscapeControlBar.m @@ -152,6 +152,8 @@ - (void)controlBarStatusSwitchTo:(PLVLCLinkMicControlBarStatus)status{ [self onOffButtonColorChange:PLVColor_OnOffButton_Red]; [self textLabelContentChange:@"请求中..."]; + + [self mediaControlButtonsShow:NO]; }else if (status == PLVLCLinkMicControlBarStatus_Joined){ // 已连麦,显示相关的控制按钮 [self onOffButtonRotate:YES]; [self onOffButtonColorChange:PLVColor_OnOffButton_Red]; @@ -407,9 +409,12 @@ - (void)textLabelContentChange:(NSString *)text{ weakSelf.textLabel.alpha = 0; } completion:^(BOOL finished) { weakSelf.textLabel.text = text; - [UIView animateWithDuration:(totalTime / 2.0) animations:^{ - weakSelf.textLabel.alpha = 1; - }]; + if (weakSelf.status != PLVLCLinkMicControlBarStatus_Joined) { + [UIView animateWithDuration:(totalTime / 2.0) animations:^{ + weakSelf.textLabel.alpha = 1; + }completion:^(BOOL finished) { + }]; + } }]; } diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicPortraitControlBar.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicPortraitControlBar.m index bf011ee7..d1ae1ffc 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicPortraitControlBar.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/LinkMic/View/ControlBar/PLVLCLinkMicPortraitControlBar.m @@ -548,9 +548,12 @@ - (void)textLabelContentChange:(NSString *)text{ weakSelf.textLabel.alpha = 0; } completion:^(BOOL finished) { weakSelf.textLabel.text = text; - [UIView animateWithDuration:(totalTime / 2.0) animations:^{ - weakSelf.textLabel.alpha = 1; - }]; + if (weakSelf.status != PLVLCLinkMicControlBarStatus_Joined) { + [UIView animateWithDuration:(totalTime / 2.0) animations:^{ + weakSelf.textLabel.alpha = 1; + }completion:^(BOOL finished) { + }]; + } }]; } diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/PLVLCMediaAreaView.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/PLVLCMediaAreaView.m index b51dc322..5a36b51e 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/PLVLCMediaAreaView.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/PLVLCMediaAreaView.m @@ -669,7 +669,8 @@ - (void)plvLCBasePlayerSkinViewBackButtonClicked:(PLVLCBasePlayerSkinView *)skin } } -- (void)plvLCBasePlayerSkinViewRotateScreen:(PLVLCBasePlayerSkinView *)skinView{ +- (void)plvLCBasePlayerSkinViewSynchOtherView:(PLVLCBasePlayerSkinView *)skinView{ + //更新MoreView视图的Superview,执行此代理时意味着skinView对象为当前显示的皮肤 [self.moreView updateMoreViewOnSuperview:skinView.superview]; } diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.h b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.h index a63b9cd0..fe071f7a 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.h +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.h @@ -40,7 +40,8 @@ NS_ASSUME_NONNULL_BEGIN ///显示窗口 - (void)showMoreViewOnSuperview:(UIView *)superview; -///当屏幕旋转时更新superview 和 frame(适合横竖屏切换的场景) +/// 更新moreView父视图及布局 +/// @note 在横竖屏旋转切换的场景下,适合调用该方法;仅在moreView已显示的情况下,该方法调用有效 - (void)updateMoreViewOnSuperview:(UIView *)superview; - (void)switchShowStatusWithAnimation; diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.m index 08aad525..759d2efe 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/MoreView/PLVLCMediaMoreView.m @@ -118,25 +118,22 @@ - (void)updateTableViewWithDataArrayByMatchModel:(NSArray } } -- (void)showMoreViewOnSuperview:(UIView *)superview{ +- (void)showMoreViewOnSuperview:(UIView *)superview { [self removeFromSuperview]; [superview addSubview:self]; self.frame = superview.bounds; [self.superview bringSubviewToFront:self]; /// 保证在父视图中,层级最前 - [self switchShowStatusWithAnimation]; + if (!_moreViewShow) { + [self switchShowStatusWithAnimation]; + } } //当屏幕旋转的时候需要重新设置superview 和 frame - (void)updateMoreViewOnSuperview:(UIView *)superview { - if (!_moreViewShow) return; - [self removeFromSuperview]; - [superview addSubview:self]; - - self.frame = superview.bounds; - [self.superview bringSubviewToFront:self]; /// 保证在父视图中,层级最前 - _moreViewShow = NO; - [self switchShowStatusWithAnimation]; + if (_moreViewShow) { + [self showMoreViewOnSuperview:superview]; + } } - (void)switchShowStatusWithAnimation{ diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.h b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.h index ffa403e4..b097f9c6 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.h +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.h @@ -119,7 +119,12 @@ typedef NS_ENUM(NSUInteger, PLVLCBasePlayerSkinViewLiveStatus) { - (void)plvLCBasePlayerSkinViewFullScreenOpenButtonClicked:(PLVLCBasePlayerSkinView *)skinView; -- (void)plvLCBasePlayerSkinViewRotateScreen:(PLVLCBasePlayerSkinView *)skinView; +/// ‘当前皮肤视图’ 已同步 ‘其他皮肤视图’按钮状态的回调 +/// +/// @note 当调用 [synchOtherSkinViewState:] 方法成功时,将触发此回调方法; +/// +/// @param skinView 当前 媒体播放器皮肤视图 对象本身 (注意:该参数非 [synchOtherSkinViewState:] 中的otherSkinView) +- (void)plvLCBasePlayerSkinViewSynchOtherView:(PLVLCBasePlayerSkinView *)skinView; /// 询问是否有其他视图处理此次触摸事件 /// diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.m index 9cb4de09..ac312989 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/Media/View/SkinView/PLVLCBasePlayerSkinView.m @@ -194,8 +194,8 @@ - (void)synchOtherSkinViewState:(PLVLCBasePlayerSkinView *)otherSkinView{ [self switchSkinViewLiveStatusTo:otherSkinView.skinViewLiveStatus]; self.playButton.selected = otherSkinView.playButton.selected; self.floatViewShowButton.selected = otherSkinView.floatViewShowButton.selected; - if (self.baseDelegate && [self.baseDelegate respondsToSelector:@selector(plvLCBasePlayerSkinViewRotateScreen:)]) { - [self.baseDelegate plvLCBasePlayerSkinViewRotateScreen:self]; + if (self.baseDelegate && [self.baseDelegate respondsToSelector:@selector(plvLCBasePlayerSkinViewSynchOtherView:)]) { + [self.baseDelegate plvLCBasePlayerSkinViewSynchOtherView:self]; } }else{ NSLog(@"PLVLCBasePlayerSkinView[%@] - synchOtherSkinViewState failed, other skin view:%@",NSStringFromClass(self.class),otherSkinView); diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/PageMenu/PLVLCPageController.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/PageMenu/PLVLCPageController.m index 6fe3dcb2..31adf58e 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/PageMenu/PLVLCPageController.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Modules/PageMenu/PLVLCPageController.m @@ -64,6 +64,7 @@ - (void)viewWillLayoutSubviews { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { self.titleCollectionView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), kBarHeight); self.seperator.frame = CGRectMake(0, kBarHeight, CGRectGetWidth(self.view.bounds), kSeperatorHeight); + self.pageController.view.frame = CGRectMake(0, kBarHeight + kSeperatorHeight, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) - kBarHeight - kSeperatorHeight); } } diff --git a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Scenes/PLVLCCloudClassViewController.m b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Scenes/PLVLCCloudClassViewController.m index 59a53830..4a8241ff 100644 --- a/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Scenes/PLVLCCloudClassViewController.m +++ b/PolyvLiveScenesDemo/PLVLiveCloudClassScene/Scenes/PLVLCCloudClassViewController.m @@ -226,9 +226,6 @@ - (void)updateUI { self.hideLinkMicAreaViewInSmallScreen = NO; } } - - [self.mediaAreaView.skinView setFloatViewButtonWithShowStatus:showLinkMicAreaView]; - [self.liveRoomSkinView setFloatViewButtonWithShowStatus:showLinkMicAreaView]; } BOOL fullScreen = [UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height; @@ -448,12 +445,7 @@ - (void)willResignActive:(NSNotification *)notification { - (void)interfaceOrientationDidChange:(NSNotification *)notification { BOOL fullScreen = [UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height; - BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - //iPad 屏幕旋转此方法会执行两次需要判断 - if (isPad) { - //iPad 因为执行两次的时候第二次和第一次结果一样导致fullScreenDifferent为NO页面不刷新 暂时iPad特殊处理 -- 可能是因为iPad四个方向,iPhone只支持3个方向 - self.fullScreenDifferent = YES; - } else { + if (!self.fullScreenDifferent) { self.fullScreenDifferent = (self.currentLandscape != fullScreen); } self.currentLandscape = fullScreen; diff --git a/PolyvLiveScenesDemo/PLVLiveEcommerceScene/Modules/Chatroom/PLVECChatroomViewModel.m b/PolyvLiveScenesDemo/PLVLiveEcommerceScene/Modules/Chatroom/PLVECChatroomViewModel.m index a1dae595..955a3132 100644 --- a/PolyvLiveScenesDemo/PLVLiveEcommerceScene/Modules/Chatroom/PLVECChatroomViewModel.m +++ b/PolyvLiveScenesDemo/PLVLiveEcommerceScene/Modules/Chatroom/PLVECChatroomViewModel.m @@ -110,10 +110,11 @@ - (void)loadImageEmotions { - (BOOL)sendSpeakMessage:(NSString *)content { PLVChatModel *model = [self.presenter sendSpeakMessage:content]; - if (model) { + BOOL sendSuccess = model && ![PLVChatroomManager sharedManager].closeRoom; + if (sendSuccess) { [self addPublicChatModel:model]; } - return model != nil; + return sendSuccess; } - (BOOL)sendGiftMessageWithData:(NSDictionary *)data tip:(NSString *)tip { diff --git a/PolyvLiveScenesDemo/PLVLiveHiClassScene/Modules/Chatroom/PLVHCChatroomSheet.m b/PolyvLiveScenesDemo/PLVLiveHiClassScene/Modules/Chatroom/PLVHCChatroomSheet.m index e3043ed5..52f879f6 100644 --- a/PolyvLiveScenesDemo/PLVLiveHiClassScene/Modules/Chatroom/PLVHCChatroomSheet.m +++ b/PolyvLiveScenesDemo/PLVLiveHiClassScene/Modules/Chatroom/PLVHCChatroomSheet.m @@ -48,10 +48,6 @@ - (void)setColumnNumber:(NSInteger)columnNumber { [PLVImageManager manager].columnNumber = columnNumber; } -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortrait; -} - @end @interface PLVHCChatroomSheet()< diff --git a/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/PLVLSChatroomAreaView.m b/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/PLVLSChatroomAreaView.m index 1067a59a..36f04045 100644 --- a/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/PLVLSChatroomAreaView.m +++ b/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/PLVLSChatroomAreaView.m @@ -62,10 +62,11 @@ - (instancetype)init { - (void)layoutSubviews { [super layoutSubviews]; + BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; CGFloat normalPadding = isPad ? 12 : 8; - CGFloat areaViewWidth = self.bounds.size.width; + CGFloat areaViewWidth = [UIScreen mainScreen].bounds.size.width * 0.34; // 支持小屏后,聊天室区域保持宽度34%不变 CGFloat areaViewHeight = self.bounds.size.height; self.chatroomListView.frame = CGRectMake(normalPadding, 0, areaViewWidth - normalPadding, areaViewHeight - 36 - 8 * 2); self.hideListViewButton.frame = CGRectMake(normalPadding, areaViewHeight - normalPadding - 36, 36, 36); diff --git a/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/View/SendMsgView/PLVLSSendMessageView.m b/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/View/SendMsgView/PLVLSSendMessageView.m index 7edcc112..8e7aeada 100644 --- a/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/View/SendMsgView/PLVLSSendMessageView.m +++ b/PolyvLiveScenesDemo/PLVLiveStreamerScene/Modules/Chatroom/View/SendMsgView/PLVLSSendMessageView.m @@ -39,10 +39,6 @@ - (void)setColumnNumber:(NSInteger)columnNumber { [PLVImageManager manager].columnNumber = columnNumber; } -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; -} - @end @interface PLVLSSendMessageView ()< diff --git a/PolyvLiveScenesDemo/PLVLiveStreamerScene/Scenes/PLVLSStreamerViewController.m b/PolyvLiveScenesDemo/PLVLiveStreamerScene/Scenes/PLVLSStreamerViewController.m index db67ec1d..64b13187 100644 --- a/PolyvLiveScenesDemo/PLVLiveStreamerScene/Scenes/PLVLSStreamerViewController.m +++ b/PolyvLiveScenesDemo/PLVLiveStreamerScene/Scenes/PLVLSStreamerViewController.m @@ -129,7 +129,7 @@ - (void)viewWillLayoutSubviews { self.linkMicAreaView.frame = CGRectMake(CGRectGetMaxX(self.documentAreaView.frame) + linkMicAreaViewLeftPadding, CGRectGetMaxY(self.statusAreaView.frame), linkMicAreaViewWidth, ducomentViewHeight); // 设置聊天室宽高 - CGFloat chatroomAreaViewWidth = [UIScreen mainScreen].bounds.size.width * 0.34; + CGFloat chatroomAreaViewWidth = [UIScreen mainScreen].bounds.size.width * ([UIScreen mainScreen].bounds.size.width <= 667 ? 0.5 : 0.34); // 适配小屏输入框无法响应点击事件,chatroomAreaView内部适配聊天宽度 CGFloat chatroomAreaViewHeigh = [UIScreen mainScreen].bounds.size.height * (isPad ? 0.28 : 0.42) + 44; self.chatroomAreaView.frame = CGRectMake(PLVLSUtils.safeSidePad, screenSize.height - PLVLSUtils.safeBottomPad - chatroomAreaViewHeigh, chatroomAreaViewWidth, chatroomAreaViewHeigh); diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/PLVSAChatroomAreaView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/PLVSAChatroomAreaView.m index a5c1cadc..46cfd7cb 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/PLVSAChatroomAreaView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/PLVSAChatroomAreaView.m @@ -64,12 +64,12 @@ - (instancetype)init { if (self) { self.backgroundColor = [UIColor clearColor]; - [self addSubview:self.welcomView]; - [self addSubview:self.chatroomListView]; [self.chatroomListView addSubview:self.receiveNewMessageView]; + [self addSubview:self.welcomView]; + [PLVSAChatroomViewModel sharedViewModel].delegate = self; // 提前初始化 sendMsgView,避免弹出时才初始化导致卡顿 @@ -86,11 +86,15 @@ - (void)layoutSubviews { CGFloat areaViewWidth = self.bounds.size.width; CGFloat areaViewHeight = self.bounds.size.height; BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - CGFloat chatroomListViewLeft = isPad ? 24 : 8; + BOOL landscape = [PLVSAUtils sharedUtils].landscape; + + CGFloat chatroomListViewLeft = isPad ? 24 : (landscape ? 36 : 8); self.chatroomListView.frame = CGRectMake(chatroomListViewLeft, 0, areaViewWidth - chatroomListViewLeft, areaViewHeight); self.receiveNewMessageView.frame = CGRectMake(0, self.chatroomListView.frame.size.height - 28, 86, 24); - self.welcomView.frame = CGRectMake(0, CGRectGetMinY(self.chatroomListView.frame)-22-15, 258, 22); + self.welcomView.frame = CGRectMake(0, MAX(CGRectGetMinY(self.chatroomListView.frame)-22-15 , 0), 258, 22); + + _giftView.frame = CGRectMake(0, CGRectGetMinY(self.welcomView.frame)- 40 - 15, 270, 40); } #pragma mark - [ Public Method ] @@ -149,8 +153,7 @@ - (PLVSAChatroomWelcomView *)welcomView { - (PLVSAChatroomGiftView *)giftView { if (!_giftView) { - CGRect rect = CGRectMake(0, CGRectGetHeight(self.bounds)-335-P_SafeAreaBottomEdgeInsets(), 270, 40); - _giftView = [[PLVSAChatroomGiftView alloc] initWithFrame:rect]; + _giftView = [[PLVSAChatroomGiftView alloc] init]; [self addSubview:_giftView]; } return _giftView; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/PLVSAChatroomGiftView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/PLVSAChatroomGiftView.m index 415075ba..6dea3429 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/PLVSAChatroomGiftView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/PLVSAChatroomGiftView.m @@ -122,7 +122,6 @@ - (void)dismiss { self.frame = self.originViewFrame; } - #pragma mark Getter - (UIImageView *)backgroundImgView { diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSAEmojiSelectView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSAEmojiSelectView.m index 36d4cca7..b95f16d6 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSAEmojiSelectView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSAEmojiSelectView.m @@ -166,8 +166,8 @@ - (UIButton *)deleteButton { if (!_deleteButton) { _deleteButton = [UIButton buttonWithType:UIButtonTypeCustom]; _deleteButton.layer.cornerRadius = 4.0; - _deleteButton.backgroundColor = PLV_UIColorFromRGB(@"#3E3E4E");; - [_deleteButton setImage:[PLVSAUtils imageForToolbarResource:@"plvsa_toolbar_btn_emoji"] forState:UIControlStateNormal]; + _deleteButton.backgroundColor = PLV_UIColorFromRGB(@"#3E3E4E"); + [_deleteButton setImage:[PLVSAUtils imageForChatroomResource:@"plvsa_chatrrom_btn_emojiDelete"] forState:UIControlStateNormal]; [_deleteButton addTarget:self action:@selector(deleteButtonTouchBegin)forControlEvents:UIControlEventTouchDown]; [_deleteButton addTarget:self action:@selector(deleteButtonTouchEnd)forControlEvents:UIControlEventTouchUpInside]; [_deleteButton addTarget:self action:@selector(deleteButtonTouchEnd)forControlEvents:UIControlEventTouchUpOutside]; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageToolView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageToolView.m index 559a2b08..5586b9e4 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageToolView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageToolView.m @@ -42,11 +42,15 @@ - (instancetype)init { - (void)layoutSubviews { CGFloat margin = 8; - self.imageButton.frame = CGRectMake(self.bounds.size.width - margin - 28, margin, 28, 28); - self.emojiButton.frame = CGRectMake(CGRectGetMinX(self.imageButton.frame) - 28 - margin, margin, 28, 28); + CGFloat safeLeft = [PLVSAUtils sharedUtils].areaInsets.left; + CGFloat safeRight = [PLVSAUtils sharedUtils].areaInsets.right; + CGFloat rightViewWith = 28 * 2 + margin *3 + safeRight; + CGFloat textViewBgWidth = self.bounds.size.width - safeLeft - margin - rightViewWith; - CGFloat textViewBgWidth = self.emojiButton.frame.origin.x - margin *2 ; - self.textViewBgView.frame = CGRectMake(margin, 6, textViewBgWidth, 32); + self.textViewBgView.frame = CGRectMake(safeLeft + margin, 6, textViewBgWidth, 32); + + self.imageButton.frame = CGRectMake(self.bounds.size.width - safeRight - margin - 28, margin, 28, 28); + self.emojiButton.frame = CGRectMake(CGRectGetMinX(self.imageButton.frame) - margin - 28, margin, 28, 28); self.textView.frame = CGRectMake(margin, 0, textViewBgWidth - 2 * 12, 32); } @@ -58,7 +62,7 @@ - (UIButton *)emojiButton { if (!_emojiButton) { _emojiButton = [UIButton buttonWithType:UIButtonTypeCustom]; _emojiButton.imageView.contentMode = UIViewContentModeScaleAspectFit; - UIImage *image = [PLVSAUtils imageForToolbarResource:@"plvsa_toolbar_btn_emoji"]; + UIImage *image = [PLVSAUtils imageForChatroomResource:@"plvsa_chatroom_btn_emoji"]; [_emojiButton setImage:image forState:UIControlStateNormal]; [_emojiButton addTarget:self action:@selector(emojiButtonAction) forControlEvents:UIControlEventTouchUpInside]; } diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageView.m index a95cbb95..818a6922 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Chatroom/View/SendMsgView/PLVSASendMessageView.m @@ -47,10 +47,6 @@ - (void)setColumnNumber:(NSInteger)columnNumber { [PLVImageManager manager].columnNumber = columnNumber; } -- (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortrait; -} - @end /// 设置允许自定义键盘的隐藏延迟时间 @@ -113,7 +109,6 @@ - (void)dealloc { - (void)layoutSubviews { [super layoutSubviews]; - } #pragma mark - [ Public Method ] - (void)showWithChatModel:(PLVChatModel *)model { @@ -157,10 +152,12 @@ - (void)dismiss { self.customKeyboardHide = NO; self.toolView.textView.inputView = nil; self.toolView.tapGesture.enabled = NO; + self.toolView.emojiButton.selected = NO; [self.toolView.textView reloadInputViews]; [self.toolView.textView becomeFirstResponder]; [self.toolView.textView resignFirstResponder]; - + self.imagePicker = nil; + [self removeFromWindow]; } @@ -291,7 +288,8 @@ - (PLVSAEmojiSelectView *)emojiboard { - (PLVImagePickerController *)imagePicker { if (!_imagePicker) { - _imagePicker = [[PLVImagePickerController alloc] initWithMaxImagesCount:1 columnNumber:4 delegate:nil]; + NSInteger columnNumber = [PLVSAUtils sharedUtils].isLandscape ? 8 : 4; + _imagePicker = [[PLVImagePickerController alloc] initWithMaxImagesCount:1 columnNumber:columnNumber delegate:nil]; _imagePicker.view.backgroundColor = [PLVColorUtil colorFromHexString:@"#1A1B1F"]; _imagePicker.showSelectBtn = YES; _imagePicker.allowTakeVideo = NO; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/PLVSALinkMicAreaView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/PLVSALinkMicAreaView.m index 53f2fff9..1baa6f1c 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/PLVSALinkMicAreaView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/PLVSALinkMicAreaView.m @@ -48,6 +48,7 @@ - (void)layoutSubviews { if (self.windowsView.superview == self) { // 开播后windowsView会被移到homeView上 self.windowsView.frame = self.bounds; } + [self setBgImageViewImage]; // 设置背景图片,适配横竖屏 } #pragma mark - [ Public Method ] @@ -72,7 +73,6 @@ - (void)setupUI { - (UIImageView *)bgImageView { if (!_bgImageView) { _bgImageView = [[UIImageView alloc] init]; - _bgImageView.image = [PLVSAUtils imageForLinkMicResource:@"plvsa_linkmic_bg"]; } return _bgImageView; } @@ -85,6 +85,14 @@ - (PLVSALinkMicWindowsView *)windowsView { return _windowsView; } +- (void)setBgImageViewImage { + if ([PLVSAUtils sharedUtils].isLandscape) { + self.bgImageView.image = [PLVSAUtils imageForLinkMicResource:@"plvsa_linkmic_bg_landscape"]; + } else { + self.bgImageView.image = [PLVSAUtils imageForLinkMicResource:@"plvsa_linkmic_bg"]; + } +} + #pragma mark - [ Delegate ] #pragma mark PLVSALinkMicWindowsViewDelegate @@ -127,8 +135,14 @@ - (PLVLinkMicOnlineUser *)onlineUserInLinkMicWindowsView:(PLVSALinkMicWindowsVie - (void)linkMicWindowsView:(PLVSALinkMicWindowsView *)windowsView didSelectOnlineUser:(PLVLinkMicOnlineUser *)onlineUser { // 显示连麦成员信息弹层 - CGFloat sheetHeight = [UIScreen mainScreen].bounds.size.height * 0.32; - PLVSALinkMicUserInfoSheet *linkMicUserSheet = [[PLVSALinkMicUserInfoSheet alloc] initWithSheetHeight:sheetHeight]; + CGFloat heightScale = 0.32; + CGFloat widthScale = 0.37; + CGFloat maxWH = MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); + + CGFloat sheetHeight = maxWH * heightScale; + CGFloat sheetLandscapeWidth = maxWH * widthScale; + + PLVSALinkMicUserInfoSheet *linkMicUserSheet = [[PLVSALinkMicUserInfoSheet alloc] initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; [linkMicUserSheet updateLinkMicUserInfoWithUser:onlineUser]; [linkMicUserSheet showInView:[PLVSAUtils sharedUtils].homeVC.view]; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.h index 34bcb56d..3747f6c5 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.h @@ -15,10 +15,6 @@ NS_ASSUME_NONNULL_BEGIN /// 连麦用户信息弹窗 @interface PLVSALinkMicUserInfoSheet : PLVSABottomSheet -/// 初始化方法 -/// @param sheetHeight 弹层弹出高度 -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight; - /// 展示连麦用户信息弹窗 /// @param user 连麦用户信息 - (void)updateLinkMicUserInfoWithUser:(PLVLinkMicOnlineUser *)user; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.m index 4d130783..5a4f0af6 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/PLVSALinkMicUserInfoSheet.m @@ -42,8 +42,8 @@ @implementation PLVSALinkMicUserInfoSheet #pragma mark - [ Life Cycle ] -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { - self = [super initWithSheetHeight:sheetHeight]; +- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight sheetLandscapeWidth:(CGFloat)sheetLandscapeWidth { + self = [super initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; if (self) { [self.contentView addSubview:self.headerImageView]; [self.contentView addSubview:self.actorLabel]; @@ -62,8 +62,9 @@ - (void)layoutSubviews { [super layoutSubviews]; BOOL specialType = [self isSpecialIdentityWithUserType:self.user.userType]; - BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; + CGFloat width = self.contentView.frame.size.width; CGFloat buttonWidth = 44; CGFloat buttonHeight = 58; @@ -72,14 +73,14 @@ - (void)layoutSubviews { CGFloat buttonTop = self.bounds.size.height > 667 ? 32 : 18; CGFloat lineViewTop = 12; CGFloat lineViewMargin = 23.5; - + if (isPad) { buttonPadding = 0.28 * (width - buttonWidth * buttonCount) / (buttonCount - 1); lineViewTop = 24; lineViewMargin = 56; } - self.headerImageView.frame = CGRectMake((width - 66) / 2, 17, 66, 66); + self.headerImageView.frame = CGRectMake((width - 66) / 2, isLandscape ? 32 : 17, 66, 66); CGFloat actorLabelWidth = [self.actorLabel sizeThatFits:CGSizeMake(width, 18)].width + 10; self.actorLabel.frame = CGRectMake((width - actorLabelWidth) / 2, CGRectGetMaxY(self.headerImageView.frame) - 18, actorLabelWidth, 18); diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/WindowsView/PLVSALinkMicWindowsView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/WindowsView/PLVSALinkMicWindowsView.m index 26aca86e..4b1810f1 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/WindowsView/PLVSALinkMicWindowsView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/LinkMic/View/WindowsView/PLVSALinkMicWindowsView.m @@ -54,18 +54,33 @@ - (void)layoutSubviews { self.collectionView.frame = self.bounds; } else { BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; CGFloat top = [PLVSAUtils sharedUtils].areaInsets.top; + CGFloat bottom = [PLVSAUtils sharedUtils].areaInsets.bottom; CGFloat collectionViewTop = top + 78; CGFloat collectionViewHeight = 280; + CGFloat collectionViewBottom = 52 + bottom; + if (isPad) { - collectionViewTop = top + 92; - collectionViewHeight = 0.74 * self.bounds.size.width; + if (isLandscape) { + collectionViewTop = self.bounds.size.height / 4.0; + collectionViewHeight = self.bounds.size.height / 2.0; + } else { + collectionViewTop = top + 92; + collectionViewHeight = 0.74 * self.bounds.size.width; + } + } else { + if (isLandscape) { + collectionViewTop = top + 56; + collectionViewHeight = self.bounds.size.height- collectionViewTop - collectionViewBottom; + } } self.collectionView.frame = CGRectMake(0, collectionViewTop, self.bounds.size.width, collectionViewHeight); } self.collectionView.contentOffset = CGPointZero; [self.collectionView setCollectionViewLayout:self.collectionViewLayout animated:YES]; + [self.collectionView.collectionViewLayout invalidateLayout]; } #pragma mark - [ Public Method ] @@ -210,7 +225,14 @@ - (CGSize)collectionView:(UICollectionView *)collectionView return self.bounds.size; } else { BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - CGFloat height = isPad ? 0.74 * self.bounds.size.width : 280; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; + CGFloat height = 280; + if (isLandscape) { + height = CGRectGetHeight(self.collectionView.frame); + } + if (isPad && !isLandscape) { + height = 0.74 * self.bounds.size.width; + } return CGSizeMake(self.bounds.size.width / 2.0, height); } } diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerFinishView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerFinishView.m index 2c2d8b34..30b94462 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerFinishView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerFinishView.m @@ -46,12 +46,15 @@ - (instancetype)init { - (void)layoutSubviews { [super layoutSubviews]; BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; + CGFloat top = [PLVSAUtils sharedUtils].areaInsets.top; CGFloat bottom = [PLVSAUtils sharedUtils].areaInsets.bottom; CGFloat finishButtonWidth = 180; - CGFloat finishButtonBottom = 85; - CGFloat liveEndImageViewTop = 40; + CGFloat finishButtonBottom = isLandscape ? 44 : 85; + CGFloat liveEndImageViewTop = isLandscape ? 38 : 40; + CGFloat liveTimeLableTop = isLandscape ? 20 : 42; + CGFloat liveTimeLineTop = isLandscape ? 18 : 40; if (isPad) { finishButtonWidth = self.bounds.size.width * 0.468; finishButtonBottom = self.bounds.size.height * 0.117; @@ -63,8 +66,8 @@ - (void)layoutSubviews { self.liveEndImageView.frame = CGRectMake((CGRectGetWidth(self.bounds) - 100) / 2, top + liveEndImageViewTop, 100, 84); self.liveEndLable.frame = CGRectMake((CGRectGetWidth(self.bounds) - 120) / 2, UIViewGetBottom(self.liveEndImageView) + 6, 120, 33); - self.dividingLineView.frame = CGRectMake((CGRectGetWidth(self.bounds) - 2) / 2, UIViewGetBottom(self.liveEndLable) + 40, 2, 52); - self.liveDetailTimeLable.frame = CGRectMake(UIViewGetLeft(self.dividingLineView) - 30 - 100, UIViewGetBottom(self.liveEndLable) + 42, 100, 22); + self.dividingLineView.frame = CGRectMake((CGRectGetWidth(self.bounds) - 2) / 2, UIViewGetBottom(self.liveEndLable) + liveTimeLineTop, 2, 52); + self.liveDetailTimeLable.frame = CGRectMake(UIViewGetLeft(self.dividingLineView) - 30 - 100, UIViewGetBottom(self.liveEndLable) + liveTimeLableTop, 100, 22); self.liveDurationTimeLable.frame = CGRectMake(UIViewGetRight(self.dividingLineView) + 56, UIViewGetTop(self.liveDetailTimeLable), 50, 22); self.detailTimeTitleLable.frame = CGRectMake(CGRectGetMidX(self.liveDetailTimeLable.frame) - 56 / 2, UIViewGetBottom(self.liveDetailTimeLable) + 8, 56, 20); diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerHomeView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerHomeView.m index ff8f166b..70f19834 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerHomeView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerHomeView.m @@ -106,18 +106,22 @@ - (void)layoutSubviews { CGSize selfSize = self.bounds.size; + CGFloat left = [PLVSAUtils sharedUtils].areaInsets.left; CGFloat right = [PLVSAUtils sharedUtils].areaInsets.right; CGFloat top = [PLVSAUtils sharedUtils].areaInsets.top; CGFloat bottom = [PLVSAUtils sharedUtils].areaInsets.bottom; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; - CGFloat marginTop = 2; - CGFloat marginLeft = 2; - CGFloat toolbarAreaViewHeight = 60; - CGFloat chatroomWidthScale = 0.65; - CGFloat chatroomHeightScale = 0.28; + CGFloat marginTop = isLandscape ? 16 : 2; + CGFloat marginLeft = isLandscape ? 36 : 2; + CGFloat toolbarAreaViewHeight = isLandscape ? 56 : 60; + CGFloat chatroomWidthScale = (isLandscape ? 0.3 : 0.65); + CGFloat chatroomHeightScale = (isLandscape ? 0.42 : 0.28); + CGFloat linkMicWindowHeight = (isLandscape ? (self.bounds.size.height - top - 52 - 44 - bottom) : 280); CGFloat cameraAndMicphoneStateViewTop = 5; - CGFloat linkMicWindowHeight = 280; - CGFloat linkMicWindowY = 78; + CGFloat linkMicWindowY = (isLandscape ? 44 : 78); + CGFloat guiedViewOffsetY = (isLandscape ? -25 : 8); + CGFloat guiedViewOffsetX = (isLandscape ? 100 : 15); BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; if (isPad) { @@ -129,35 +133,46 @@ - (void)layoutSubviews { cameraAndMicphoneStateViewTop = 20; linkMicWindowHeight = 0.74 * self.bounds.size.width; linkMicWindowY = 92; + if (isLandscape) { + linkMicWindowHeight = self.bounds.size.height / 2.0; + linkMicWindowY = self.bounds.size.height / 4.0 - top; + } } - self.closeButton.frame = CGRectMake(selfSize.width - 44 - right - marginLeft, top + marginTop, 44, 44); + + CGFloat closeButtonWitdh = isLandscape ? 32 : 44; + self.closeButton.frame = CGRectMake(selfSize.width - closeButtonWitdh - right - marginLeft, top + marginTop, closeButtonWitdh, closeButtonWitdh); BOOL first = CGRectEqualToRect(self.scrollView.frame, CGRectZero); self.scrollView.frame = self.bounds; self.scrollView.contentSize = CGSizeMake(selfSize.width * 2, selfSize.height); - self.linkMicTipView.frame = CGRectMake(selfSize.width - 214, selfSize.height - bottom - 32 - 20, 214, 32); + // 实际显示时,会在ShowNewWaitUserAdded方法内,根据当前在第几屏更新x、y + CGFloat linkMicTipRightPadding = isLandscape ? 32 : 8; + self.linkMicTipView.frame = CGRectMake(selfSize.width - 214 - linkMicTipRightPadding - right , selfSize.height - bottom - 32 - 20, 214, 32); CGRect pageRect = self.scrollView.bounds; pageRect.origin.x = self.scrollView.bounds.size.width; self.homePageView.frame = pageRect; + self.scrollView.contentOffset = CGPointMake(selfSize.width, 0); if (first) { - self.scrollView.contentOffset = CGPointMake(selfSize.width, 0); self.linkMicWindowsView.frame = pageRect; } else { - CGRect linkMicWindowFrame = self.linkMicWindowsView.frame; + CGRect linkMicWindowFrame = pageRect; linkMicWindowFrame.origin.x = self.scrollView.contentOffset.x; self.linkMicWindowsView.frame = linkMicWindowFrame; } - - self.statusbarAreaView.frame = CGRectMake(0, top, selfSize.width, 72); - self.cameraAndMicphoneStateView.frame = CGRectMake(0, CGRectGetMaxY(self.statusbarAreaView.frame) + cameraAndMicphoneStateViewTop, selfSize.width, 36); - self.toolbarAreaView.frame = CGRectMake(0, selfSize.height - bottom - toolbarAreaViewHeight, selfSize.width, toolbarAreaViewHeight); - self.chatroomAreaView.frame = CGRectMake(0, CGRectGetMinY(self.toolbarAreaView.frame) - selfSize.height * chatroomHeightScale, selfSize.width * chatroomWidthScale, selfSize.height * chatroomHeightScale); + + self.statusbarAreaView.frame = CGRectMake(left, top, selfSize.width - left - right, 72); + self.cameraAndMicphoneStateView.frame = CGRectMake(left, CGRectGetMaxY(self.statusbarAreaView.frame) + cameraAndMicphoneStateViewTop, selfSize.width - left - right, 36); + self.toolbarAreaView.frame = CGRectMake(left, selfSize.height - bottom - toolbarAreaViewHeight, selfSize.width - left - right, toolbarAreaViewHeight); + + CGFloat chatroomWidth = selfSize.width * chatroomWidthScale; + CGFloat chatroomHeight = selfSize.height * chatroomHeightScale; + self.chatroomAreaView.frame = CGRectMake(left, CGRectGetMinY(self.toolbarAreaView.frame) - chatroomHeight, chatroomWidth, chatroomHeight); self.slideRightTipsView.frame = self.bounds; - self.linkMicGuiedView.frame = CGRectMake(selfSize.width - 173 - 15, top + linkMicWindowY + linkMicWindowHeight + 8, 173, 50); + self.linkMicGuiedView.frame = CGRectMake(selfSize.width - 173 - guiedViewOffsetX, top + linkMicWindowY + linkMicWindowHeight + guiedViewOffsetY, 173, 50); } #pragma mark - [ Override ] @@ -229,15 +244,16 @@ - (void)showMemberBadge:(BOOL)show { - (void)ShowNewWaitUserAdded { BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - CGFloat padding = isPad ? 24 : 8; + CGFloat padding = isPad ? 24 : ([PLVSAUtils sharedUtils].isLandscape ? 36 : 8); CGRect frame = self.linkMicTipView.frame; CGSize selfSize = self.bounds.size; CGFloat bottom = [PLVSAUtils sharedUtils].areaInsets.bottom; + CGFloat right = [PLVSAUtils sharedUtils].areaInsets.right + padding; if (self.scrollView.contentOffset.x == 0) { - frame.origin.x = selfSize.width - frame.size.width - padding; + frame.origin.x = selfSize.width - frame.size.width - right; frame.origin.y = selfSize.height - bottom - 20 - frame.size.height ; } else { - frame.origin.x = selfSize.width *2 - frame.size.width - padding; + frame.origin.x = selfSize.width *2 - frame.size.width - right; frame.origin.y = CGRectGetMinY(self.toolbarAreaView.frame) - frame.size.height - 16; } @@ -337,6 +353,10 @@ - (UIScrollView *)scrollView { _scrollView.delegate = self; _scrollView.pagingEnabled = YES; _scrollView.showsHorizontalScrollIndicator = NO; + _scrollView.bounces = NO; + if (@available(iOS 11.0, *)) { + _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } } return _scrollView; } @@ -390,18 +410,27 @@ - (PLVSAChatroomAreaView *)chatroomAreaView { - (PLVSAChannelInfoSheet *)channelInfoSheet { if (!_channelInfoSheet) { - CGFloat scale = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 0.301 : 0.285; - CGFloat sheetHeight = [UIScreen mainScreen].bounds.size.height * scale; - _channelInfoSheet = [[PLVSAChannelInfoSheet alloc] initWithSheetHeight:sheetHeight]; + CGFloat heightScale = 0.285; + CGFloat widthScale = 0.318; + heightScale = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 0.301 : heightScale; + CGFloat maxWH = MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); + CGFloat sheetHeight = maxWH * heightScale; + CGFloat sheetLandscapeWidth = maxWH * widthScale; + + _channelInfoSheet = [[PLVSAChannelInfoSheet alloc] initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; } return _channelInfoSheet; } - (PLVSAMoreInfoSheet *)moreInfoSheet { if (!_moreInfoSheet) { - CGFloat scale = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 0.246 : 0.34; - CGFloat sheetHeight = [UIScreen mainScreen].bounds.size.height * scale; - _moreInfoSheet = [[PLVSAMoreInfoSheet alloc] initWithSheetHeight:sheetHeight]; + CGFloat heightScale = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 0.246 : 0.34; + CGFloat widthScale = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 0.18 :0.37; + CGFloat maxWH = MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); + CGFloat sheetHeight = maxWH * heightScale; + CGFloat sheetLandscapeWidth = maxWH * widthScale; + + _moreInfoSheet = [[PLVSAMoreInfoSheet alloc] initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; _moreInfoSheet.delegate = self; } return _moreInfoSheet; @@ -409,9 +438,13 @@ - (PLVSAMoreInfoSheet *)moreInfoSheet { - (PLVSABitRateSheet *)bitRateSheet { if (!_bitRateSheet) { - CGFloat scale = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 0.233 : 0.285; - CGFloat sheetHeight = [UIScreen mainScreen].bounds.size.height * scale; - _bitRateSheet = [[PLVSABitRateSheet alloc] initWithSheetHeight:sheetHeight]; + BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + CGFloat heightScale = isPad ? 0.233 : 0.285; + CGFloat widthScale = 0.23; + CGFloat maxWH = MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); + CGFloat sheetHeight = maxWH * heightScale; + CGFloat sheetLandscapeWidth = maxWH * widthScale; + _bitRateSheet = [[PLVSABitRateSheet alloc] initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; _bitRateSheet.delegate = self; PLVResolutionType type = [self.delegate streamerHomeViewCurrentQuality:self]; [_bitRateSheet setupBitRateOptionsWithCurrentBitRate:type]; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.h index 6e37ae62..b6b36d0f 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.h @@ -17,6 +17,8 @@ @property (nonatomic, weak) id delegate; +@property (nonatomic, assign, readonly) BOOL canAutorotate; + /** 是否禁用摄像头和镜像按钮 @@ -27,6 +29,9 @@ /// 是否禁用镜像按钮 - (void)enableMirrorButton:(BOOL)enable; +/// 是否禁用横竖屏按钮 +- (void)enableOrientationButton:(BOOL)enable; + @end @protocol PLVSAStreamerSettingViewDelegate diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.m index 0d9462d5..13112dba 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/PLVSAStreamerSettingView.m @@ -42,6 +42,8 @@ @interface PLVSAStreamerSettingView () 48 ? 51 : self.channelNameLableHeight; + CGFloat scrollViewHeight = isLandscape && !isPad ? textHeight : self.channelNameLableHeight; + self.scrollView.frame = CGRectMake(channelNameLableLeft, 28, configViewWidth - channelNameLableLeft * 2, scrollViewHeight); + self.scrollView.contentSize = CGSizeMake(CGRectGetWidth(self.scrollView.frame), self.channelNameLableHeight); + self.channelNameLable.frame = CGRectMake(0, 0, CGRectGetWidth(self.scrollView.bounds), self.channelNameLableHeight); + + /// 分割线 + self.lineView.frame = CGRectMake(lineViewLeft, UIViewGetBottom(self.scrollView) + 13, CGRectGetWidth(self.configView.bounds) - lineViewLeft * 2, 1); + + /// 底部按钮 CGSize buttonSize = CGSizeMake(32, 58); CGFloat buttonTop = CGRectGetMaxY(self.configView.bounds) - buttonSize.height - 33; - CGFloat buttonPadding = (CGRectGetWidth(self.configView.bounds) - buttonSize.width * 3 - 20) / 4 + 10; - self.mirrorButton.frame = CGRectMake((configViewWidth - buttonSize.width) / 2, buttonTop, buttonSize.width, buttonSize.height); + CGFloat orientationButtonOffsetWidth = 15.0; + CGFloat buttonPadding = (CGRectGetWidth(self.configView.bounds) - (buttonSize.width * 4 + orientationButtonOffsetWidth)) / 5; self.cameraReverseButton.frame = CGRectMake(buttonPadding, buttonTop, buttonSize.width, buttonSize.height); - self.bitRateButton.frame = CGRectMake(CGRectGetMaxX(self.configView.bounds) - buttonPadding - buttonSize.width, buttonTop, buttonSize.width, buttonSize.height); + self.mirrorButton.frame = CGRectMake(UIViewGetRight(self.cameraReverseButton) + buttonPadding, buttonTop, buttonSize.width, buttonSize.height); + self.bitRateButton.frame = CGRectMake(UIViewGetRight(self.mirrorButton) + buttonPadding, buttonTop, buttonSize.width, buttonSize.height); + self.orientationButton.frame = CGRectMake(UIViewGetRight(self.bitRateButton) + buttonPadding, buttonTop, buttonSize.width + orientationButtonOffsetWidth, buttonSize.height); + } /// 初始化默认清晰度 @@ -191,6 +214,25 @@ - (void)initChannelName { self.channelNameTextView.text = channelName; } +/// 收起输入框 +- (void)takeBackTextView { + CGFloat textViewX = [PLVSAUtils sharedUtils].landscape ? 136 : 29.5; + CGFloat textViewWidth = CGRectGetWidth(self.bounds) - textViewX * 2; + self.channelNameTextView.frame = CGRectMake(textViewX, CGRectGetHeight(self.bounds), textViewWidth, 50); + self.limitLable.frame = CGRectMake(UIViewGetRight(self.channelNameTextView) - 80 - 10, UIViewGetBottom(self.channelNameTextView) + 17 + 20, 80, 17); +} + +/// 弹出输入框 +- (void)popupTextView:(CGFloat)keyboardY { + /// 根据键盘高度设置输入框的坐标 + CGFloat paddingY = 12; + CGFloat textViewX = [PLVSAUtils sharedUtils].landscape ? 136 : 29.5; + CGFloat textViewWidth = CGRectGetWidth(self.bounds) - textViewX * 2; + CGFloat textViewHeight = [self.channelNameTextView sizeThatFits:CGSizeMake(textViewWidth, MAXFLOAT)].height; + self.channelNameTextView.frame = CGRectMake(textViewX, keyboardY - textViewHeight - 17 - paddingY, textViewWidth, textViewHeight); + self.limitLable.frame = CGRectMake(UIViewGetRight(self.channelNameTextView) - 80 - 10, keyboardY - 4 - 17, 80, 17); +} + - (UIButton *)buttonWithTitle:(NSString *)title NormalImageString:(NSString *)normalImageString selectedImageString:(NSString *)selectedImageString { UIButton *button = [[UIButton alloc] init]; button.imageView.contentMode = UIViewContentModeScaleAspectFit; @@ -247,6 +289,11 @@ - (void)changeBitRateButtonTitleAndImageWithBitRate:(PLVResolutionType)resolutio } } +- (void)showConfigView:(BOOL)show { + self.configView.hidden = !show; + self.maskView.hidden = show; +} + #pragma mark Getter & Setter - (UIButton *)backButtton { @@ -331,6 +378,15 @@ - (UIButton *)bitRateButton { return _bitRateButton; } +- (UIButton *)orientationButton { + if (!_orientationButton) { + _orientationButton = [self buttonWithTitle:@"横竖屏" NormalImageString:@"plvsa_liveroom_btn_orientation" selectedImageString:@"plvsa_liveroom_btn_orientation"]; + [_orientationButton addTarget:self action:@selector(orientationAction:) forControlEvents:UIControlEventTouchUpInside]; + _orientationButton.imageEdgeInsets = UIEdgeInsetsMake(0,10,25,10); + } + return _orientationButton; +} + - (UILabel *)channelNameLable { if (!_channelNameLable) { _channelNameLable = [[UILabel alloc]init]; @@ -381,12 +437,23 @@ - (UIView *)lineView { return _lineView; } +- (UIScrollView *)scrollView { + if (!_scrollView) { + _scrollView = [[UIScrollView alloc] init]; + _scrollView.showsVerticalScrollIndicator = NO; + } + return _scrollView; +} + - (PLVSABitRateSheet *)bitRateSheet { if (!_bitRateSheet) { BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - CGFloat scale = isPad ? 0.233 : 0.285; - CGFloat sheetHeight = [UIScreen mainScreen].bounds.size.height * scale; - _bitRateSheet = [[PLVSABitRateSheet alloc] initWithSheetHeight:sheetHeight]; + CGFloat heightScale = isPad ? 0.233 : 0.285; + CGFloat widthScale = 0.23; + CGFloat maxWH = MAX([UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width); + CGFloat sheetHeight = maxWH * heightScale; + CGFloat sheetLandscapeWidth = maxWH * widthScale; + _bitRateSheet = [[PLVSABitRateSheet alloc] initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; [_bitRateSheet setupBitRateOptionsWithCurrentBitRate:self.resolutionType]; _bitRateSheet.delegate = self; } @@ -430,6 +497,16 @@ - (void)bitRateAction:(UIButton *)sender { [self.bitRateSheet showInView:self]; } +- (void)orientationAction:(UIButton *)sender { + sender.selected = !sender.selected; + self.canAutorotate = YES; + UIDeviceOrientation orientation = sender.selected ? UIDeviceOrientationLandscapeLeft : UIDeviceOrientationPortrait; + [PLVFdUtil changeDeviceOrientation:orientation]; + self.canAutorotate = NO; + // 缓存设备方向 + [[PLVSAUtils sharedUtils] setupDeviceOrientation:orientation]; +} + - (void)startEditingAction:(UITapGestureRecognizer *)tap { double newLength = [self calculateTextLengthWithString:self.channelNameTextView.text]; @@ -471,11 +548,10 @@ - (void)textViewDidChange:(UITextView *)textView { CGFloat lableHeight = [self.channelNameLable sizeThatFits:CGSizeMake(self.channelNameLable.frame.size.width, MAXFLOAT)].height; self.configViewHeight += lableHeight - self.channelNameLableHeight; self.channelNameLableHeight = lableHeight; - self.channelNameTextViewHeight = textViewHeight; CGRect rect = self.channelNameTextView.frame; - self.channelNameTextView.frame = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, self.channelNameTextViewHeight); - self.limitLable.frame = CGRectMake(UIViewGetRight(self.channelNameTextView) - 80 - 10, UIViewGetBottom(self.channelNameTextView) + 17 + 20, 80, 17); + CGFloat offsetHeight = textViewHeight - rect.size.height; + self.channelNameTextView.frame = CGRectMake(rect.origin.x, rect.origin.y - offsetHeight, rect.size.width, textViewHeight); } - (void)textViewDidEndEditing:(UITextView *)textView { @@ -506,13 +582,13 @@ - (void)plvsaBitRateSheet:(PLVSABitRateSheet *)bitRateSheet bitRateButtonClickWi #pragma mark - [ Event ] #pragma mark Notification - (void)keyboardWillShow:(NSNotification *)notification { - self.maskView.hidden = NO; - self.configView.hidden = YES; + [self showConfigView:NO]; + CGFloat keyboardY = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue].origin.y; + [self popupTextView:keyboardY]; } - (void)keyboardWillHide:(NSNotification *)notification { - self.maskView.hidden = YES; - self.configView.hidden = NO; + [self showConfigView:YES]; BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; if (isPad) { @@ -521,8 +597,9 @@ - (void)keyboardWillHide:(NSNotification *)notification { } else { self.configView.frame = CGRectMake(UIViewGetLeft(self.startButton), UIViewGetTop(self.startButton) - 24 - self.configViewHeight, CGRectGetWidth(self.startButton.frame), self.configViewHeight); } - - self.channelNameLable.frame = CGRectMake(28, 28, CGRectGetWidth(self.configView.bounds) - 56, self.channelNameLableHeight); + + self.channelNameLable.frame = CGRectMake(0, 0, CGRectGetWidth(self.scrollView.bounds), self.channelNameLableHeight); + [self takeBackTextView]; } #pragma mark - [ Public Method ] @@ -535,4 +612,8 @@ - (void)enableMirrorButton:(BOOL)enable{ self.mirrorButton.enabled = enable; } +- (void)enableOrientationButton:(BOOL)enable{ + self.orientationButton.enabled = enable; +} + @end diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.h index 91c2501c..8484df2f 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.h @@ -25,8 +25,6 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, weak) id delegate; -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight; - /** 传入清晰度选中对应按钮 diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.m index bf6a46a6..b3ea2572 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABitRateSheet.m @@ -32,9 +32,8 @@ @implementation PLVSABitRateSheet #pragma mark - [ Life Cycle ] - -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { - self = [super initWithSheetHeight:sheetHeight]; +- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight sheetLandscapeWidth:(CGFloat)sheetLandscapeWidth { + self = [super initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; if (self) { [self initUI]; } @@ -56,10 +55,11 @@ - (void)layoutSubviews { CGFloat buttonHeight = 36; CGFloat buttonY = 83; CGFloat contentViewWidth = self.contentView.bounds.size.width; - CGFloat padding = (contentViewWidth - self.optionsButtonArray.count * buttonWidth) / (self.optionsButtonArray.count + 1); + CGFloat paddingX = (contentViewWidth - self.optionsButtonArray.count * buttonWidth) / (self.optionsButtonArray.count + 1); // iPad时的中间和两边边距 CGFloat middlePadding = 0; CGFloat margin = 0; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; if (isPad) { titleLableLeft = 56; @@ -67,14 +67,19 @@ - (void)layoutSubviews { middlePadding = contentViewWidth * 0.052; margin = (contentViewWidth - middlePadding * (self.optionsButtonArray.count - 1) - buttonWidth * self.optionsButtonArray.count) / 2; } - self.titleLable.frame = CGRectMake(titleLableLeft, 32, 90, 18); for (int i = 0; i < self.optionsButtonArray.count; i ++) { UIButton *button = self.optionsButtonArray[i]; - CGFloat buttonX = (i * buttonWidth) + (i + 1) * padding; + CGFloat buttonX = (i * buttonWidth) + (i + 1) * paddingX; + CGFloat paddingY = 24; if (isPad) { buttonX = (i * buttonWidth) + margin + (i * middlePadding); + paddingY = 88; + } + if (isLandscape) { + buttonX = titleLableLeft; + buttonY = CGRectGetMaxY(self.titleLable.frame) + 31 + (i * buttonHeight) + (i + 1) * paddingY; } button.frame = CGRectMake(buttonX , buttonY, buttonWidth, buttonHeight); diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.h index d83cad12..9da0a53f 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.h @@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN @interface PLVSABottomSheet : UIView @property (nonatomic, assign) CGFloat sheetHight; // 弹层显示时的高度 +@property (nonatomic, assign) CGFloat sheetLandscapeWidth; // 弹层横屏时弹出宽度 + @property (nonatomic, strong, readonly) UIView *contentView; // 底部内容区域 @property (nonatomic, copy) void(^didCloseSheet)(void); // 弹层隐藏时的回调 @@ -21,6 +23,13 @@ NS_ASSUME_NONNULL_BEGIN /// @param sheetHeight 弹层弹出高度 - (instancetype)initWithSheetHeight:(CGFloat)sheetHeight; +/// 初始化方法,支持横竖屏 +/// @note 竖屏时:弹窗宽充满屏幕宽度,高度为sheetHeight; +/// 横屏时:弹窗宽为sheetLandscapeWidth + 右安全距离,高度充满屏幕高度。 +/// @param sheetHeight 弹层弹出宽度 +/// @param sheetLandscapeWidth 弹层横屏时弹出宽度,需要支持横屏时此值必须大于0 +- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight sheetLandscapeWidth:(CGFloat)sheetLandscapeWidth; + /// 弹出弹层 /// @param parentView 展示弹层的父视图,弹层会插入到父视图的最顶上 - (void)showInView:(UIView *)parentView; @@ -28,6 +37,9 @@ NS_ASSUME_NONNULL_BEGIN /// 收起弹层 - (void)dismiss; +/// 设备横竖屏方向发生变化时调用,子类可以重写此方法来修改UI,重写时请务必添加[super deviceOrientationDidChange] +- (void)deviceOrientationDidChange; + @end NS_ASSUME_NONNULL_END diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.m index a4fc6f6b..e49617f9 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSABottomSheet.m @@ -7,6 +7,10 @@ // #import "PLVSABottomSheet.h" +// 工具 +#import "PLVSAUtils.h" + +// 依赖库 #import static CGFloat kBottomSheetAnimationDuration = 0.25; @@ -17,6 +21,10 @@ @interface PLVSABottomSheet () @property (nonatomic, strong) UIView *contentView; // 底部内容区域 @property (nonatomic, strong) UIVisualEffectView *effectView; // 高斯模糊效果图 +#pragma mark 数据 +@property (nonatomic, assign) BOOL superLandscape; // 是否支持横屏 +@property (nonatomic, assign) UIInterfaceOrientation currentOrientaion; // 当前方向 + @end @implementation PLVSABottomSheet @@ -24,9 +32,17 @@ @implementation PLVSABottomSheet #pragma mark - Life Cycle - (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { + return [self initWithSheetHeight:sheetHeight sheetLandscapeWidth:0]; +} + +- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight sheetLandscapeWidth:(CGFloat)sheetLandscapeWidth { self = [super init]; if (self) { + self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + self.currentOrientaion = [PLVSAUtils sharedUtils].interfaceOrientation; self.sheetHight = MAX(0, sheetHeight); + self.sheetLandscapeWidth = sheetLandscapeWidth; + self.superLandscape = sheetLandscapeWidth > 0; [self addSubview:self.gestureView]; [self addSubview:self.contentView]; @@ -37,14 +53,26 @@ - (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { - (void)layoutSubviews { [super layoutSubviews]; + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; maskLayer.frame = self.contentView.bounds; + UIRectCorner corners = UIRectCornerTopLeft | UIRectCornerTopRight; + if ([PLVSAUtils sharedUtils].isLandscape && + self.superLandscape) { + corners = UIRectCornerTopLeft | UIRectCornerBottomLeft; + } maskLayer.path = [UIBezierPath bezierPathWithRoundedRect:self.contentView.bounds - byRoundingCorners:UIRectCornerTopRight | UIRectCornerTopLeft + byRoundingCorners:corners cornerRadii:CGSizeMake(16, 16)].CGPath; self.contentView.layer.mask = maskLayer; } +#pragma mark - [ Public Method ] + +- (void)deviceOrientationDidChange { + [self resetWithAnimate]; +} + #pragma mark - Getter - (UIView *)gestureView { @@ -84,11 +112,11 @@ - (void)showInView:(UIView *)parentView { [parentView addSubview:self]; [parentView insertSubview:self atIndex:parentView.subviews.count - 1]; - [self reset]; - [UIView animateWithDuration:kBottomSheetAnimationDuration animations:^{ - self.contentView.frame = CGRectMake(0, self.bounds.size.height - self.sheetHight, self.bounds.size.width, self.sheetHight); - self.effectView.frame = self.contentView.bounds; - } completion:nil]; + if (self.superLandscape) { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChangeNotification:) name:UIDeviceOrientationDidChangeNotification object:nil]; + } + + [self resetWithAnimate]; } - (void)dismiss { @@ -97,10 +125,16 @@ - (void)dismiss { } [UIView animateWithDuration:kBottomSheetAnimationDuration animations:^{ - self.contentView.frame = CGRectMake(0, self.bounds.size.height, self.bounds.size.width, self.sheetHight); + if ([PLVSAUtils sharedUtils].isLandscape && + self.superLandscape) { + self.contentView.frame = CGRectMake(self.bounds.size.width, 0, self.sheetLandscapeWidth, self.bounds.size.height); + } else { + self.contentView.frame = CGRectMake(0, self.bounds.size.height, self.bounds.size.width, self.sheetHight); + } self.effectView.frame = self.contentView.bounds; } completion:^(BOOL finished) { [self removeFromSuperview]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; if (self.didCloseSheet) { self.didCloseSheet(); } @@ -110,8 +144,44 @@ - (void)dismiss { - (void)reset { self.frame = self.superview.bounds; self.gestureView.frame = self.bounds; - self.contentView.frame = CGRectMake(0, self.bounds.size.height, self.bounds.size.width, self.sheetHight); + + if ([PLVSAUtils sharedUtils].isLandscape && + self.superLandscape) { + self.contentView.frame = CGRectMake(self.bounds.size.width, 0, self.sheetLandscapeWidth, self.bounds.size.height); + } else { + self.contentView.frame = CGRectMake(0, self.bounds.size.height, self.bounds.size.width, self.sheetHight); + + } self.effectView.frame = self.contentView.bounds; } +- (void)resetWithAnimate { + [self reset]; + [UIView animateWithDuration:kBottomSheetAnimationDuration animations:^{ + if ([PLVSAUtils sharedUtils].isLandscape && + self.superLandscape) { + self.contentView.frame = CGRectMake(self.bounds.size.width - self.sheetLandscapeWidth - [PLVSAUtils sharedUtils].areaInsets.right, 0, self.sheetLandscapeWidth + [PLVSAUtils sharedUtils].areaInsets.right, self.bounds.size.height); + } else { + self.contentView.frame = CGRectMake(0, self.bounds.size.height - self.sheetHight, self.bounds.size.width, self.sheetHight); + } + self.effectView.frame = self.contentView.bounds; + } completion:nil]; +} + +#pragma mark - [ Delegate ] +#pragma mark UIDeviceOrientationDidChangeNotification + +- (void)deviceOrientationDidChangeNotification:(NSNotification *)notify { + UIInterfaceOrientation orientaion = [UIApplication sharedApplication].statusBarOrientation; + if (orientaion == self.currentOrientaion) { + return; + } + if (orientaion == UIInterfaceOrientationPortrait || + orientaion == UIInterfaceOrientationLandscapeLeft || + orientaion == UIInterfaceOrientationLandscapeRight) { + self.currentOrientaion = orientaion; + [self deviceOrientationDidChange]; + } +} + @end diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.h index 29ab03c1..775dde1c 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.h @@ -16,10 +16,6 @@ NS_ASSUME_NONNULL_BEGIN /// 频道信息弹层 @interface PLVSAChannelInfoSheet : PLVSABottomSheet -/// 初始化方法 -/// @param sheetHeight 弹层弹出高度 -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight; - /// 展示频道信息 /// @param roomData 频道信息所需要的元数据 - (void)updateChannelInfoWithData:(PLVRoomData *)roomData; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.m index 5e11aab2..b62cddf9 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAChannelInfoSheet.m @@ -26,8 +26,10 @@ @interface PLVSAChannelInfoSheet() @property (nonatomic, strong) UILabel *sheetTitleLabel; // 弹层顶部标题 @property (nonatomic, strong) UILabel *liveTitleLabel; // 直播名称标题 @property (nonatomic, strong) UILabel *liveTitleContentLabel; // 直播名称内容 -@property (nonatomic, strong) UILabel *beginTimeLabel; // 开始时间 -@property (nonatomic, strong) UILabel *channelIdLabel; // 频道号 +@property (nonatomic, strong) UILabel *beginTimeTitleLabel; // 开始时间标题 +@property (nonatomic, strong) UILabel *beginTimeContentLabel; // 开始时间内容 +@property (nonatomic, strong) UILabel *channelIdTitleLabel; // 频道号标题 +@property (nonatomic, strong) UILabel *channelIdContentLabel; // 频道号内容 @property (nonatomic, strong) UIButton *cloneChannelIdButton; // 复制频道号按钮 @end @@ -37,51 +39,72 @@ @implementation PLVSAChannelInfoSheet #pragma mark - [ Life Cycle ] -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { - self = [super initWithSheetHeight:sheetHeight]; + +- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight sheetLandscapeWidth:(CGFloat)sheetLandscapeWidth { + self = [super initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; if (self) { [self.contentView addSubview:self.sheetTitleLabel]; [self.contentView addSubview:self.liveTitleLabel]; [self.contentView addSubview:self.liveTitleContentLabel]; - [self.contentView addSubview:self.beginTimeLabel]; - [self.contentView addSubview:self.channelIdLabel]; + [self.contentView addSubview:self.beginTimeTitleLabel]; + [self.contentView addSubview:self.beginTimeContentLabel]; + [self.contentView addSubview:self.channelIdTitleLabel]; + [self.contentView addSubview:self.channelIdContentLabel]; [self.contentView addSubview:self.cloneChannelIdButton]; } return self; } - -#pragma mark - [ Override ] - - (void)layoutSubviews { [super layoutSubviews]; BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; + CGFloat margin = isPad ? 56 : 30; - CGFloat xPadding = self.bounds.size.height > 667 ? 34 : 17; - CGFloat width = self.bounds.size.width - margin * 2; + CGFloat xPadding = (self.bounds.size.height > 667 || isLandscape) ? 34 : 17; + CGFloat width = isLandscape ? self.sheetLandscapeWidth : self.bounds.size.width; + width -= margin * 2; - CGSize titleContentSize = [self.liveTitleContentLabel sizeThatFits:CGSizeMake(width - 50, CGFLOAT_MAX)]; - if (titleContentSize.height <= 17) { - xPadding = 34; - } + self.sheetTitleLabel.frame = CGRectMake(margin, xPadding, width, 20); CGSize size = [self.liveTitleLabel sizeThatFits:CGSizeMake(width, 20)]; self.liveTitleLabel.frame = CGRectMake(margin, CGRectGetMaxY(self.sheetTitleLabel.frame) + 22, size.width, size.height); - - self.liveTitleContentLabel.frame = CGRectMake(CGRectGetMaxX(self.liveTitleLabel.frame), self.liveTitleLabel.frame.origin.y, titleContentSize.width, titleContentSize.height); + CGFloat contentLabelX = isLandscape ? self.liveTitleLabel.frame.origin.x : CGRectGetMaxX(self.liveTitleLabel.frame); + CGFloat contentLabelY = isLandscape ? CGRectGetMaxY(self.liveTitleLabel.frame) + 6 : self.liveTitleLabel.frame.origin.y; + CGFloat maxWidth = isLandscape ? width : width - self.liveTitleLabel.frame.size.width; + CGSize titleContentSize = [self.liveTitleContentLabel sizeThatFits:CGSizeMake(maxWidth, CGFLOAT_MAX)]; + self.liveTitleContentLabel.frame = CGRectMake(contentLabelX, contentLabelY, titleContentSize.width, titleContentSize.height); - self.beginTimeLabel.frame = CGRectMake(margin, CGRectGetMaxY(self.liveTitleContentLabel.frame) + 12, width, 20); + self.beginTimeTitleLabel.frame = CGRectMake(margin, CGRectGetMaxY(self.liveTitleContentLabel.frame) + 12, size.width, size.height); + contentLabelX = isLandscape ? self.beginTimeTitleLabel.frame.origin.x : CGRectGetMaxX(self.beginTimeTitleLabel.frame); + contentLabelY = isLandscape ? CGRectGetMaxY(self.beginTimeTitleLabel.frame) + 6 : self.beginTimeTitleLabel.frame.origin.y; + maxWidth = isLandscape ? width : width - self.beginTimeTitleLabel.frame.size.width; + self.beginTimeContentLabel.frame = CGRectMake(contentLabelX, contentLabelY, maxWidth, size.height); - size = [self.channelIdLabel sizeThatFits:CGSizeMake(width, 20)]; - self.channelIdLabel.frame = CGRectMake(margin, CGRectGetMaxY(self.beginTimeLabel.frame) + 16, size.width, size.height); CGFloat buttonWidth = isPad ? 80 : 50; - self.cloneChannelIdButton.frame = CGRectMake(CGRectGetMaxX(self.channelIdLabel.frame) + 12, self.channelIdLabel.frame.origin.y - 2, buttonWidth, 24); - self.cloneChannelIdButton.center = CGPointMake(self.cloneChannelIdButton.center.x, self.channelIdLabel.center.y); + size = [self.channelIdTitleLabel sizeThatFits:CGSizeMake(width, 20)]; + self.channelIdTitleLabel.frame = CGRectMake(margin, CGRectGetMaxY(self.beginTimeContentLabel.frame) + 16, size.width, size.height); + contentLabelX = isLandscape ? self.channelIdTitleLabel.frame.origin.x : CGRectGetMaxX(self.channelIdTitleLabel.frame); + contentLabelY = isLandscape ? CGRectGetMaxY(self.channelIdTitleLabel.frame) + 6 : self.channelIdTitleLabel.frame.origin.y; + maxWidth = isLandscape ? width : width - self.channelIdTitleLabel.frame.size.width - buttonWidth; + size = [self.channelIdContentLabel sizeThatFits:CGSizeMake(maxWidth, 20)]; + self.channelIdContentLabel.frame = CGRectMake(contentLabelX, contentLabelY, size.width, size.height); + + + self.cloneChannelIdButton.frame = CGRectMake(CGRectGetMaxX(self.channelIdContentLabel.frame) + 12, self.channelIdTitleLabel.frame.origin.y - 2, buttonWidth, 24); + self.cloneChannelIdButton.center = CGPointMake(self.cloneChannelIdButton.center.x, self.channelIdContentLabel.center.y); } + +#pragma mark - [ Override ] + +- (void)deviceOrientationDidChange { + [super deviceOrientationDidChange]; + [self setNeedsLayout]; +} + #pragma mark - [ Public Method ] - (void)updateChannelInfoWithData:(PLVRoomData *)roomData { @@ -91,21 +114,22 @@ - (void)updateChannelInfoWithData:(PLVRoomData *)roomData { } NSString *titleString = roomData.channelName; - if (!titleString || ![titleString isKindOfClass:[NSString class]]) { + if (![PLVFdUtil checkStringUseable:titleString]) { titleString = @""; } NSString *dateString = roomData.menuInfo.startTime; - - if (!dateString || ![dateString isKindOfClass:[NSString class]] || dateString.length == 0) { + if (![PLVFdUtil checkStringUseable:dateString]) { dateString = @"无"; } - self.liveTitleLabel.text = @"直播名称:"; + NSString *channelIdString = roomData.channelId; + if (![PLVFdUtil checkStringUseable:channelIdString]) { + channelIdString = @"无"; + } self.liveTitleContentLabel.text = titleString; - - self.beginTimeLabel.attributedText = [self createAttributedStringWithTitle:@"开始时间:" content:dateString]; - self.channelIdLabel.attributedText = [self createAttributedStringWithTitle:@"频道号:" content:roomData.channelId]; + self.beginTimeContentLabel.text = dateString; + self.channelIdContentLabel.text = channelIdString; } #pragma mark - [ Private Method ] @@ -135,6 +159,7 @@ - (UILabel *)liveTitleLabel { _liveTitleLabel = [[UILabel alloc] init]; _liveTitleLabel.font = [UIFont systemFontOfSize:14]; _liveTitleLabel.textColor = PLV_UIColorFromRGB(@"#AFAFAF"); + _liveTitleLabel.text = @"直播名称:"; } return _liveTitleLabel; } @@ -149,22 +174,44 @@ - (UILabel *)liveTitleContentLabel { return _liveTitleContentLabel; } -- (UILabel *)beginTimeLabel { - if (!_beginTimeLabel) { - _beginTimeLabel = [[UILabel alloc] init]; - _beginTimeLabel.font = [UIFont systemFontOfSize:14]; - _beginTimeLabel.textColor = [UIColor colorWithRed:240/255.0 green:241/255.0 blue:245/255.0 alpha:1/1.0]; +- (UILabel *)beginTimeTitleLabel { + if (!_beginTimeTitleLabel) { + _beginTimeTitleLabel = [[UILabel alloc] init]; + _beginTimeTitleLabel.font = [UIFont systemFontOfSize:14]; + _beginTimeTitleLabel.textColor = [UIColor colorWithRed:240/255.0 green:241/255.0 blue:245/255.0 alpha:1/1.0]; + _beginTimeTitleLabel.text = @"开始时间:"; + } + return _beginTimeTitleLabel; +} + +- (UILabel *)beginTimeContentLabel { + if (!_beginTimeContentLabel) { + _beginTimeContentLabel = [[UILabel alloc] init]; + _beginTimeContentLabel.font = [UIFont systemFontOfSize:14]; + _beginTimeContentLabel.textColor = [UIColor colorWithRed:240/255.0 green:241/255.0 blue:245/255.0 alpha:1/1.0]; + _beginTimeContentLabel.numberOfLines = 0; + } + return _beginTimeContentLabel; +} + +- (UILabel *)channelIdTitleLabel { + if (!_channelIdTitleLabel) { + _channelIdTitleLabel = [[UILabel alloc] init]; + _channelIdTitleLabel.font = [UIFont systemFontOfSize:14]; + _channelIdTitleLabel.textColor = [UIColor colorWithRed:240/255.0 green:241/255.0 blue:245/255.0 alpha:1/1.0]; + _channelIdTitleLabel.text = @"频道号:"; } - return _beginTimeLabel; + return _channelIdTitleLabel; } -- (UILabel *)channelIdLabel { - if (!_channelIdLabel) { - _channelIdLabel = [[UILabel alloc] init]; - _channelIdLabel.font = [UIFont systemFontOfSize:14]; - _channelIdLabel.textColor = [UIColor colorWithRed:240/255.0 green:241/255.0 blue:245/255.0 alpha:1/1.0]; +- (UILabel *)channelIdContentLabel { + if (!_channelIdContentLabel) { + _channelIdContentLabel = [[UILabel alloc] init]; + _channelIdContentLabel.font = [UIFont systemFontOfSize:14]; + _channelIdContentLabel.textColor = [UIColor colorWithRed:240/255.0 green:241/255.0 blue:245/255.0 alpha:1/1.0]; + _channelIdContentLabel.numberOfLines = 0; } - return _channelIdLabel; + return _channelIdContentLabel; } - (UIButton *)cloneChannelIdButton { diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAFinishStreamerSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAFinishStreamerSheet.m index b70d0e2c..4cf7b928 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAFinishStreamerSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAFinishStreamerSheet.m @@ -42,7 +42,7 @@ - (instancetype)init { - (void)layoutSubviews { [super layoutSubviews]; - + self.finishButton.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, kButtonHeight); self.line.frame = CGRectMake(0, kButtonHeight, self.contentView.bounds.size.width, kLineHeight); self.cancelButton.frame = CGRectMake(0, kButtonHeight + kLineHeight, self.contentView.bounds.size.width, self.sheetHight - kLineHeight - kButtonHeight); diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.h index 5380d14b..7c07e7ef 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.h @@ -63,11 +63,6 @@ NS_ASSUME_NONNULL_BEGIN /// 当前 全体禁言 当前是否开启 @property (nonatomic, assign) BOOL closeRoom; - -/// 初始化方法 -/// @param sheetHeight 弹层弹出高度 -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight; - /// 改变闪光灯按钮选中状态 - (void)changeFlashButtonSelectedState:(BOOL)selectedState; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.m index 790a6a69..5308904a 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/Sheet/PLVSAMoreInfoSheet.m @@ -34,8 +34,8 @@ @implementation PLVSAMoreInfoSheet #pragma mark - [ Life Cycle ] -- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { - self = [super initWithSheetHeight:sheetHeight]; +- (instancetype)initWithSheetHeight:(CGFloat)sheetHeight sheetLandscapeWidth:(CGFloat)sheetLandscapeWidth{ + self = [super initWithSheetHeight:sheetHeight sheetLandscapeWidth:sheetLandscapeWidth]; if (self) { [self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.cameraButton]; @@ -45,7 +45,6 @@ - (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { [self.contentView addSubview:self.flashButton]; [self.contentView addSubview:self.cameraBitRateButton]; [self.contentView addSubview:self.closeRoomButton]; - } return self; } @@ -56,8 +55,10 @@ - (instancetype)initWithSheetHeight:(CGFloat)sheetHeight { - (void)layoutSubviews { [super layoutSubviews]; BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - CGFloat titleX = isPad ? 56 : 16; - CGFloat titleY = self.bounds.size.height > 667 ? 32 : 18; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; + + CGFloat titleX = isPad ? 56 : (isLandscape ? 32 : 16); + CGFloat titleY = (self.bounds.size.height > 667 || isLandscape) ? 32 : 18; self.titleLabel.frame = CGRectMake(titleX, titleY, 50, 18); [self setButtonFrameWithArray:@[self.cameraButton, @@ -259,19 +260,25 @@ - (CGFloat)getMaxButtonWidthWithArray:(NSArray *)buttonArray { - (void)setButtonFrameWithArray:(NSArray *)buttonArray { BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + BOOL isLandscape = [PLVSAUtils sharedUtils].isLandscape; - CGFloat titleLabelMaxY = ([UIScreen mainScreen].bounds.size.height > 667 ? 32 : 18) + 18; - CGFloat buttonX = 21.5; - CGFloat buttonY = self.bounds.size.height > 667 ? CGRectGetMaxY(self.titleLabel.frame) + 12 : titleLabelMaxY + 10; + CGFloat titleLabelMaxY = ((self.bounds.size.height > 667 || isLandscape) ? 32 : 18) + 18; + CGFloat buttonX = isLandscape ? 38 : 21.5; + CGFloat buttonY = (self.bounds.size.height > 667 || isLandscape) ? CGRectGetMaxY(self.titleLabel.frame) + 12 : titleLabelMaxY + 10; CGFloat buttonImageHeight = 28; CGFloat buttonWidth = [self getMaxButtonWidthWithArray:buttonArray]; CGFloat buttonHeight = buttonImageHeight + 12 +14; - CGFloat padding = (self.bounds.size.width - buttonX * 2 - buttonWidth * 5) / 4; - CGFloat margin = self.bounds.size.height > 667 ? 18 : 16; + CGFloat padding = 0; + if (isLandscape) { + padding = (self.sheetLandscapeWidth - buttonX * 2 - buttonWidth * 3) / 2; + } else { + padding = (self.bounds.size.width - buttonX * 2 - buttonWidth * 5) / 4; + } + CGFloat margin = (self.bounds.size.height > 667 || isLandscape) ? 18 : 16; if (isPad) { buttonWidth = 88; - buttonX = (self.bounds.size.width - buttonWidth * 7) / 2; + buttonX = isLandscape ? (self.contentView.bounds.size.width -buttonWidth) / 2:(self.bounds.size.width - buttonWidth * 7) / 2; buttonY = CGRectGetMaxY(self.titleLabel.frame) + 24; padding = 0; if (buttonX < 0) { @@ -290,15 +297,26 @@ - (void)setButtonFrameWithArray:(NSArray *)buttonArray { buttonHeight = MAX(titleSize.height + buttonImageHeight + 12, buttonHeight); // 换行 - if (!isPad && i == 5) { - buttonX = 21.5; - buttonY += buttonHeight + margin; + if (isLandscape) { + if (isPad) { + buttonY += buttonHeight + margin; + }else if (i == 3 || i == 6) { + buttonX = 43; + buttonY += buttonHeight + margin; + } + } else { + if (!isPad && i == 5) { + buttonX = 21.5; + buttonY += buttonHeight + margin; + } } // frame button.frame = CGRectMake(buttonX, buttonY, buttonWidth, buttonHeight); // buttonX - buttonX += buttonWidth + padding; + if (!(isPad && isLandscape)) { + buttonX += buttonWidth + padding; + } } } diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/View/PLVSASlideRightTipsView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/View/PLVSASlideRightTipsView.m index bab50bb9..7776c783 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/View/PLVSASlideRightTipsView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Liveroom/View/PLVSASlideRightTipsView.m @@ -41,18 +41,23 @@ - (void)setupUI { #pragma mark - layout - (void)layoutSubviews { CGFloat originY = [PLVSAUtils sharedUtils].areaInsets.top; - BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; - CGSize tipsImageViewSize = CGSizeMake(123, 85); - CGFloat tipsImageViewTop = originY + 220; - CGFloat tipsLableTop = UIViewGetBottom(self.tipsImageView) + 24; + if (isPad) { + CGSize tipsImageViewSize = CGSizeMake(123, 85); + CGFloat tipsImageViewTop = originY + 220; + CGFloat tipsLableTop = UIViewGetBottom(self.tipsImageView) + 24; tipsLableTop = CGRectGetHeight(self.bounds) / 2; tipsImageViewTop = tipsLableTop - 50 - tipsImageViewSize.height; + self.tipsImageView.frame = CGRectMake(0, tipsImageViewTop, tipsImageViewSize.width, tipsImageViewSize.height); + self.tipsLable.frame = CGRectMake(CGRectGetMidX(self.bounds) - 72 / 2, tipsLableTop, 72, 20); + } else { + CGFloat originX = [PLVSAUtils sharedUtils].areaInsets.left; + originY += [PLVSAUtils sharedUtils].isLandscape ? 131 : 220; + self.tipsImageView.frame = CGRectMake(originX, originY, 123, 85); + self.tipsLable.frame = CGRectMake(CGRectGetMidX(self.bounds) - 72 / 2, UIViewGetBottom(self.tipsImageView) + 24, 72, 20); } - self.tipsImageView.frame = CGRectMake(0, tipsImageViewTop, tipsImageViewSize.width, tipsImageViewSize.height); - self.tipsLable.frame = CGRectMake(CGRectGetMidX(self.bounds) - 72 / 2, tipsLableTop, 72, 20); self.closeButton.frame = CGRectMake(CGRectGetMidX(self.bounds) - 100 / 2, UIViewGetBottom(self.tipsLable) + 25, 100, 36); self.gradientLayer.frame = self.closeButton.bounds; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/PLVSAMemberSheet.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/PLVSAMemberSheet.m index 35319b68..90191396 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/PLVSAMemberSheet.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/PLVSAMemberSheet.m @@ -15,6 +15,7 @@ static CGFloat kMaxHeightScale = 0.72; static CGFloat kMinHeightScale = 0.42; +static CGFloat kMidWidthtScale = 0.49; static NSInteger kMaxLinkMicCount = 2; // 目前支持的最大连麦数(包括自己的RTC流) @@ -41,7 +42,8 @@ @implementation PLVSAMemberSheet #pragma mark - [ Life Cycle ] - (instancetype)initWithUserList:(NSArray *)userList userCount:(NSInteger)userCount { - self = [super initWithSheetHeight:kMinHeightScale * PLVScreenHeight]; + CGFloat screenHeight = MAX(PLVScreenHeight, PLVScreenWidth); + self = [super initWithSheetHeight:kMinHeightScale * screenHeight sheetLandscapeWidth:kMidWidthtScale * screenHeight]; if (self) { self.userList = userList; self.userCount = userCount; @@ -96,11 +98,15 @@ - (void)setOnlineUserCount:(NSInteger)count { } - (void)updateSheetHight { - CGFloat cellHeight = [PLVSAMemberCell cellHeight]; - CGFloat screenHeight = PLVScreenHeight; - CGFloat mSheetHeight = cellHeight * [self.userList count] + self.headerView.bounds.size.height + [PLVSAUtils sharedUtils].areaInsets.bottom; - mSheetHeight = MAX(kMinHeightScale * screenHeight, MIN(kMaxHeightScale * screenHeight, mSheetHeight)); - self.sheetHight = mSheetHeight; + if ([PLVSAUtils sharedUtils].landscape) { + self.sheetHight = PLVScreenHeight; + } else { + CGFloat cellHeight = [PLVSAMemberCell cellHeight]; + CGFloat screenHeight = PLVScreenHeight; + CGFloat mSheetHeight = cellHeight * [self.userList count] + self.headerView.bounds.size.height + [PLVSAUtils sharedUtils].areaInsets.bottom; + mSheetHeight = MAX(kMinHeightScale * screenHeight, MIN(kMaxHeightScale * screenHeight, mSheetHeight)); + self.sheetHight = mSheetHeight; + } } #pragma mark Getter & Setter diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/View/PLVSAMemberPopup.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/View/PLVSAMemberPopup.m index 4c40cc3b..37eb780b 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/View/PLVSAMemberPopup.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Member/View/PLVSAMemberPopup.m @@ -19,6 +19,12 @@ typedef NS_ENUM(NSInteger, PLVSAMemberPopupButton) { PLVSAMemberPopupButtonBanned }; +typedef NS_ENUM(NSInteger, PLVSAMemberPopupDirection) { + PLVSAMemberPopupDirectionTop = 0, + PLVSAMemberPopupDirectionBottom, + PLVSAMemberPopupDirectionLeft +}; + @interface PLVSAMemberPopup () /// UI @@ -28,7 +34,7 @@ @interface PLVSAMemberPopup () @property (nonatomic, strong) PLVChatUser *chatUser; @property (nonatomic, assign) CGFloat centerY; @property (nonatomic, strong) NSArray *buttonTypeArray; -@property (nonatomic, assign) BOOL above; +@property (nonatomic, assign) PLVSAMemberPopupDirection popupDirection; //popup弹出的方向 @end @@ -109,23 +115,39 @@ - (void)configData { if (isPad) { width += 30; } - CGFloat height = [self.buttonTypeArray count] * 44 + 10 * 2 + 9; // 44为每个按钮的高度,10为按钮与气泡的内部间隔 + CGFloat height = [self.buttonTypeArray count] * 44 + 10 * 2; // 44为每个按钮的高度,10为按钮与气泡的内部间隔 // 配置popup的frame和气泡形状的贝塞尔曲线 CGFloat screenWidth = PLVScreenWidth; CGFloat screenHeight = PLVScreenHeight; CGFloat bottom = [PLVSAUtils sharedUtils].areaInsets.bottom; - // 屏幕centerY以下位置不足以显示气泡,则气泡在centerY顶部,above为YES - self.above = (height > (screenHeight - self.centerY - bottom - 9 - 25)); // 25是centerY到气泡的Y轴距离,9是防止气泡底部贴着设备屏幕下沿 + CGFloat top = [PLVSAUtils sharedUtils].areaInsets.top; + // 屏幕centerY以下位置不足以显示气泡,则气泡在centerY顶部,顶部不足以显示则在左侧显示 + // 25是centerY到气泡的Y轴距离,9是防止气泡底部贴着设备屏幕下沿 + if ((height < (screenHeight - self.centerY - bottom - 9 - 25))) { + height += 9; + self.popupDirection = PLVSAMemberPopupDirectionBottom; + } else if ((height < (self.centerY - top - 9 - 25))) { + height += 9; + self.popupDirection = PLVSAMemberPopupDirectionTop; + } else { + width += 9; + self.popupDirection = PLVSAMemberPopupDirectionLeft; + } + CGFloat originY = 0; - if (self.above) { + CGFloat leftMargin = isPad ? 32 : 9; + if (self.popupDirection == PLVSAMemberPopupDirectionTop) { originY = self.centerY - 25 - height; self.bezierPath = [[self class] aboveBezierPathWithSize:CGSizeMake(width, height)]; - } else { + } else if (self.popupDirection == PLVSAMemberPopupDirectionBottom) { originY = self.centerY + 25; self.bezierPath = [[self class] belowBezierPathWithSize:CGSizeMake(width, height)]; + } else { + originY = self.centerY - height/2; + leftMargin = 32 + 36; + self.bezierPath = [[self class] leftBezierPathWithSize:CGSizeMake(width, height)]; } - CGFloat leftMargin = isPad ? 32 : 9; self.frame = CGRectMake(screenWidth - leftMargin - width, originY, width, height); CAShapeLayer *shapeLayer = [CAShapeLayer layer]; shapeLayer.path = self.bezierPath.CGPath; @@ -134,7 +156,7 @@ - (void)configData { - (void)updateUI { CGFloat originX = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 25.0 : 10.0; - CGFloat originY = 10.0 + (self.above ? 0 : 9); + CGFloat originY = 10.0 + (self.popupDirection == PLVSAMemberPopupDirectionBottom ? 9 : 0); for (NSNumber *typeNumber in self.buttonTypeArray) { PLVSAMemberPopupButton buttonType = [typeNumber integerValue]; @@ -306,6 +328,36 @@ + (UIBezierPath *)belowBezierPathWithSize:(CGSize)size { return bezierPath; } ++ (UIBezierPath *)leftBezierPathWithSize:(CGSize)size { + CGFloat conner = 8.0; // 圆角大小 + CGFloat trangleHeight = 9.0; // 箭头高度 + CGFloat trangleWidthForHalf = 5.0; // 箭头宽度的一半 + + UIBezierPath *bezierPath = [UIBezierPath bezierPath]; + + // 从左上角开始,顺时针绘制气泡 + [bezierPath moveToPoint:CGPointMake(conner, 0)]; + [bezierPath addLineToPoint:CGPointMake(size.width-trangleHeight-conner, 0)]; + [bezierPath addQuadCurveToPoint:CGPointMake(size.width-trangleHeight, conner) controlPoint:CGPointMake(size.width-trangleHeight, 0)]; + [bezierPath addLineToPoint:CGPointMake(size.width-trangleHeight, size.height/2 - trangleWidthForHalf)]; + + // 从上向下绘制箭头 + [bezierPath addLineToPoint:CGPointMake(size.width, size.height/2)]; + [bezierPath addLineToPoint:CGPointMake(size.width - trangleHeight, size.height/2 + trangleWidthForHalf)]; + + // 继续顺时针绘制气泡 + [bezierPath addLineToPoint:CGPointMake(size.width-trangleHeight, size.height- conner - trangleHeight)]; + [bezierPath addQuadCurveToPoint:CGPointMake(size.width - conner-trangleHeight, size.height - trangleHeight) controlPoint:CGPointMake(size.width-trangleHeight, size.height - trangleHeight)]; + [bezierPath addLineToPoint:CGPointMake(conner, size.height - trangleHeight)]; + [bezierPath addQuadCurveToPoint:CGPointMake(0, size.height - conner - trangleHeight) controlPoint:CGPointMake(0, size.height - trangleHeight)]; + [bezierPath addLineToPoint:CGPointMake(0, conner)]; + [bezierPath addQuadCurveToPoint:CGPointMake(conner, 0) controlPoint:CGPointMake(0, 0)]; + + // 气泡绘制完毕,关闭贝塞尔曲线 + [bezierPath closePath]; + return bezierPath; +} + #pragma mark - [ Event ] #pragma mark Action diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Statusbar/PLVSAStatusbarAreaView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Statusbar/PLVSAStatusbarAreaView.m index ed454eb6..b334c5cf 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Statusbar/PLVSAStatusbarAreaView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Statusbar/PLVSAStatusbarAreaView.m @@ -59,17 +59,19 @@ - (instancetype)init { - (void)layoutSubviews { [super layoutSubviews]; + BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + BOOL landscape = [PLVSAUtils sharedUtils].landscape; - CGFloat marginTop = 8; - CGFloat marginX = 8; + CGFloat marginTop = landscape ? 16 : 8; + CGFloat marginX = landscape ? 36 : 8; CGFloat padding = 8; - - BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + CGFloat signalControlX = 0.0; + CGFloat signalControlY = 0.0; + if (isPad) { marginTop = 16; marginX = 24; } - self.channelInfoButton.frame = CGRectMake(marginX, marginTop, 106, 36); CGFloat width = self.memberButton.frame.size.width; @@ -79,8 +81,15 @@ - (void)layoutSubviews { width = self.teacherNameButton.frame.size.width; self.teacherNameButton.frame = CGRectMake(marginX, CGRectGetMaxY(self.channelInfoButton.frame) + padding, width, 20); - - self.signalButton.frame = CGRectMake(self.bounds.size.width - 84 - marginX, CGRectGetMaxY(self.channelInfoButton.frame) + padding, 84, 20); + + if (landscape) { + signalControlX = self.bounds.size.width - 32 - marginX - 14 - 84; + signalControlY = 22; + } else { + signalControlX = self.bounds.size.width - 84 - marginX; + signalControlY = CGRectGetMaxY(self.channelInfoButton.frame) + padding; + } + self.signalButton.frame = CGRectMake(signalControlX, signalControlY, 84, 20); } #pragma mark - [ Public Method ] diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Toolbar/PLVSAToolbarAreaView.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Toolbar/PLVSAToolbarAreaView.m index 2a2da6d4..aa8fb66f 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Toolbar/PLVSAToolbarAreaView.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Modules/Toolbar/PLVSAToolbarAreaView.m @@ -66,11 +66,15 @@ - (instancetype)init { #pragma mark - [ Override ] - (void)layoutSubviews { [super layoutSubviews]; - CGFloat marginLeft = 8; + + BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + BOOL landscape = [PLVSAUtils sharedUtils].landscape; + + CGFloat marginLeft = landscape ? 36 : 8; CGFloat chatButtonWidth = 150; CGFloat chatButtonTop = 8; - BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad; + if (isPad) { marginLeft = 24; chatButtonWidth = 220; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emoji@2x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatroom_btn_emoji@2x.png similarity index 100% rename from PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emoji@2x.png rename to PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatroom_btn_emoji@2x.png diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emoji@3x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatroom_btn_emoji@3x.png similarity index 100% rename from PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emoji@3x.png rename to PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatroom_btn_emoji@3x.png diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emojiDelete@2x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatrrom_btn_emojiDelete@2x.png similarity index 74% rename from PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emojiDelete@2x.png rename to PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatrrom_btn_emojiDelete@2x.png index c4a8e358..78b0a02f 100755 Binary files a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emojiDelete@2x.png and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatrrom_btn_emojiDelete@2x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emojiDelete@3x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatrrom_btn_emojiDelete@3x.png similarity index 100% rename from PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAToolbar.bundle/plvsa_toolbar_btn_emojiDelete@3x.png rename to PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAChatroom.bundle/plvsa_chatrrom_btn_emojiDelete@3x.png diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@2x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@2x.png index d3feeb45..2259a5b8 100644 Binary files a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@2x.png and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@2x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@3x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@3x.png index d660c7fd..5b9196c0 100644 Binary files a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@3x.png and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg@3x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg_landscape@2x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg_landscape@2x.png new file mode 100644 index 00000000..2356c926 Binary files /dev/null and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg_landscape@2x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg_landscape@3x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg_landscape@3x.png new file mode 100644 index 00000000..682e3b32 Binary files /dev/null and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALinkMic.bundle/plvsa_linkmic_bg_landscape@3x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALiveroom.bundle/plvsa_liveroom_btn_orientation@2x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALiveroom.bundle/plvsa_liveroom_btn_orientation@2x.png new file mode 100644 index 00000000..bf0e5eba Binary files /dev/null and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALiveroom.bundle/plvsa_liveroom_btn_orientation@2x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALiveroom.bundle/plvsa_liveroom_btn_orientation@3x.png b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALiveroom.bundle/plvsa_liveroom_btn_orientation@3x.png new file mode 100644 index 00000000..ae6781c2 Binary files /dev/null and b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSALiveroom.bundle/plvsa_liveroom_btn_orientation@3x.png differ diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.h b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.h index d8cc9952..bba117e8 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.h +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.h @@ -25,9 +25,24 @@ NS_ASSUME_NONNULL_BEGIN /// 主页控制器 @property (nonatomic, weak) UIViewController *homeVC; +/// 当前屏幕方向,根据setupDeviceOrientation:方法配置的值返回对应屏幕方向 +@property (nonatomic, assign, readonly) UIInterfaceOrientation interfaceOrientation; + +/// 当前屏幕方向,根据setupDeviceOrientation:方法配置的值返回对应屏幕方向 +@property (nonatomic, assign, readonly) UIInterfaceOrientationMask interfaceOrientationMask; + /// 单例 + (instancetype)sharedUtils; +/// 设置屏幕安全距离 +/// @param areaInsets 安全距离 +- (void)setupAreaInsets:(UIEdgeInsets)areaInsets; + +/// 设置当前iPhone、iPad设备的屏幕的旋转方向,开播后不允许修改 +/// @note 用于在开播设置页中配置当前屏幕旋转方向,保证直播间旋转方向为用户开播前设置的方向。 +/// @param deviceOrientation 设备方向 +- (void)setupDeviceOrientation:(UIDeviceOrientation)deviceOrientation; + /// 在主页显示自定义 toast /// @param message toast 文本 + (void)showToastInHomeVCWithMessage:(NSString *)message; @@ -82,9 +97,6 @@ NS_ASSUME_NONNULL_BEGIN confirmActionTitle:(NSString * _Nullable)confirmActionTitle confirmActionBlock:(void(^ _Nullable)(void))confirmActionBlock; - -- (void)setupAreaInsets:(UIEdgeInsets)areaInsets; - + (UIImage *)imageForLiveroomResource:(NSString *)imageName; + (UIImage *)imageForStatusbarResource:(NSString *)imageName; diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.m index cf91b443..3c94f258 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Resource/PLVSAUtils.m @@ -14,6 +14,8 @@ @interface PLVSAUtils () @property (nonatomic, assign) UIEdgeInsets areaInsets; +@property (nonatomic, assign) UIDeviceOrientation deviceOrientation; // 设备方向,缺省值为UIDeviceOrientationPortrait(竖屏) + @end @implementation PLVSAUtils @@ -25,6 +27,7 @@ + (instancetype)sharedUtils { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ instance = [[PLVSAUtils alloc] init]; + instance.deviceOrientation = UIDeviceOrientationPortrait; }); return instance; } @@ -33,6 +36,30 @@ - (void)setupAreaInsets:(UIEdgeInsets)areaInsets { self.areaInsets = areaInsets; } +- (void)setupDeviceOrientation:(UIDeviceOrientation)deviceOrientation { + self.deviceOrientation = deviceOrientation; +} + +- (UIInterfaceOrientationMask)interfaceOrientationMask { // 屏幕的旋转,枚举值里面的 right/left 是以Home键方向为准的!和设备旋转是相反的! + if (self.deviceOrientation == UIDeviceOrientationLandscapeLeft) { + return UIInterfaceOrientationMaskLandscapeRight; + } else if(self.deviceOrientation == UIDeviceOrientationLandscapeRight) { + return UIInterfaceOrientationMaskLandscapeLeft; + } else { + return UIInterfaceOrientationMaskPortrait; + } +} + +- (UIInterfaceOrientation)interfaceOrientation { // 屏幕的旋转,枚举值里面的 right/left 是以Home键方向为准的!和设备旋转是相反的! + if (self.deviceOrientation == UIDeviceOrientationLandscapeLeft) { + return UIInterfaceOrientationLandscapeRight; + } else if(self.deviceOrientation == UIDeviceOrientationLandscapeRight) { + return UIInterfaceOrientationLandscapeLeft; + } else { + return UIInterfaceOrientationPortrait; + } +} + + (void)showToastInHomeVCWithMessage:(NSString *)message { [PLVToast showToastWithMessage:message inView:[PLVSAUtils sharedUtils].homeVC.view]; } diff --git a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Scenes/PLVSAStreamerViewController.m b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Scenes/PLVSAStreamerViewController.m index 1eab397f..8bfbfd71 100644 --- a/PolyvLiveScenesDemo/PLVStreamerAloneScene/Scenes/PLVSAStreamerViewController.m +++ b/PolyvLiveScenesDemo/PLVStreamerAloneScene/Scenes/PLVSAStreamerViewController.m @@ -137,15 +137,23 @@ - (void)viewWillLayoutSubviews { #pragma mark - [ Override ] - (BOOL)shouldAutorotate { - return YES; + return !self.streamerPresenter.classStarted && _settingView.canAutorotate; // 只允许 未开播时在'设置页'使用'横竖屏按钮'设置屏幕旋转 } - (UIInterfaceOrientationMask)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskPortrait; + if (self.streamerPresenter.classStarted) { // 开播后 返回开播前设置好的屏幕方向 + return [PLVSAUtils sharedUtils].interfaceOrientationMask; + } else { // 未开播 允许所有方向 + return UIInterfaceOrientationMaskAll; + } } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - return UIInterfaceOrientationPortrait; + if (self.streamerPresenter.classStarted) { // 开播后 返回开播前设置好的屏幕方向 + return [PLVSAUtils sharedUtils].interfaceOrientation; + } else { // 未开播 默认竖屏 + return UIInterfaceOrientationPortrait; + } } - (UIStatusBarStyle)preferredStatusBarStyle{ @@ -156,7 +164,8 @@ - (UIStatusBarStyle)preferredStatusBarStyle{ /// 登出操作 - (void)logout { - [self chatroomLogout]; + [self socketLogout]; + [PLVRoomLoginClient logout]; if (self.delegate && [self.delegate respondsToSelector:@selector(streamerViewControllerLogout:)]) { [self.delegate streamerViewControllerLogout:self]; @@ -228,6 +237,7 @@ - (PLVSACountDownView *)countDownView { - (PLVSAStreamerFinishView *)finishView { if (!_finishView) { _finishView = [[PLVSAStreamerFinishView alloc] init]; + _finishView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; __weak typeof(self) weakSelf = self; _finishView.finishButtonHandler = ^{ [weakSelf logout]; @@ -267,11 +277,6 @@ - (void)setupModule { } - (void)getEdgeInset { - if ([PLVSAUtils sharedUtils].hadSetAreaInsets) { - return; - } - - [PLVSAUtils sharedUtils].hadSetAreaInsets = YES; [PLVSAUtils sharedUtils].landscape = [UIScreen mainScreen].bounds.size.width > [UIScreen mainScreen].bounds.size.height; if (@available(iOS 11, *)) { [[PLVSAUtils sharedUtils] setupAreaInsets:self.view.safeAreaInsets]; @@ -357,6 +362,7 @@ - (void)tryStartClass:(BOOL)autoTry { if (self.streamerPresenter.networkQuality == PLVBLinkMicNetworkQualityUnknown) { NSString * tips = autoTry ? @"网络信号弱,持续检测中,请稍候再试" : @"网络检测中,请稍候"; [PLVSAUtils showToastInHomeVCWithMessage:tips]; + [self.settingView enableOrientationButton:autoTry]; if (!autoTry) { __weak typeof(self) weakSelf = self; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -385,8 +391,9 @@ - (void)finishClass { self.finishView.duration = self.streamerPresenter.pushStreamValidDuration; self.finishView.startTime = self.streamerPresenter.startPushStreamTimestamp; [self.streamerPresenter finishClass]; - // 直播间关闭 - [self chatroomLogout]; + // 退出聊天室,资源释放、状态位清零 + [PLVRoomLoginClient logout]; + [[PLVSAChatroomViewModel sharedViewModel] clear]; // 成员列表数据停止自动更新 [self.memberPresenter stop]; // 更新界面UI @@ -394,14 +401,10 @@ - (void)finishClass { }) } -#pragma mark chatroomLogout(退出登录页时调用) +#pragma mark 断开socket(退出到登录页时调用) -- (void)chatroomLogout { - // 直播间关闭 - [PLVRoomLoginClient logout]; - [[PLVSAChatroomViewModel sharedViewModel] clear]; +- (void)socketLogout { // 单独抽离的原因:调用后所有正在发送的socket消息会被中断,如'finishClass'、'OPEN_MICROPHONE'消息,导致直播间无法结束。 [[PLVSocketManager sharedManager] logout]; - } #pragma mark - [ Delegate ] @@ -625,6 +628,8 @@ - (void)streamerSettingViewBackButtonClick { - (void)streamerSettingViewStartButtonClickWithResolutionType:(PLVResolutionType)type { PLVBLinkMicStreamQuality streamQuality = [PLVRoomData streamQualityWithResolutionType:type]; + PLVBLinkMicStreamScale streamScale =[PLVSAUtils sharedUtils].isLandscape? PLVBLinkMicStreamScale16_9:PLVBLinkMicStreamScale9_16; + [self.streamerPresenter setupStreamScale:streamScale]; [self.streamerPresenter setupStreamQuality:streamQuality]; [self tryStartClass:NO]; } diff --git a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveHiClassDemo-Info.plist b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveHiClassDemo-Info.plist index 3a443262..f4c2ebe8 100644 --- a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveHiClassDemo-Info.plist +++ b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveHiClassDemo-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.7.1.1 + 1.7.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS diff --git a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveScenesDemo-Info.plist b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveScenesDemo-Info.plist index d17da411..114bdf4a 100644 --- a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveScenesDemo-Info.plist +++ b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveScenesDemo-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.7.1.1 + 1.7.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS @@ -48,7 +48,7 @@ armv7 UIRequiresFullScreen - + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait diff --git a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveStreamerDemo-Info.plist b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveStreamerDemo-Info.plist index 62955fbd..01420d78 100644 --- a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveStreamerDemo-Info.plist +++ b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveStreamerDemo-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.7.1.1 + 1.7.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS diff --git a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveWatchDemo-Info.plist b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveWatchDemo-Info.plist index 6ba7ec94..5febefb4 100644 --- a/PolyvLiveScenesDemo/Supporting Files/PolyvLiveWatchDemo-Info.plist +++ b/PolyvLiveScenesDemo/Supporting Files/PolyvLiveWatchDemo-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.7.1.1 + 1.7.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS