Skip to content

Commit

Permalink
提交 1.7.3 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
polyv-lijingtong committed Dec 7, 2021
1 parent c7c3576 commit 64fd206
Show file tree
Hide file tree
Showing 166 changed files with 3,376 additions and 2,155 deletions.
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target 'PolyvLiveScenesDemo' do
use_frameworks!

# 保利威 多场景 SDK
pod 'PLVLiveScenesSDK', '1.7.2'
pod 'PLVLiveScenesSDK', '1.7.3'

# 保利威 UI源码 需依赖的库
pod 'SDWebImage', '4.4.0'
Expand Down
162 changes: 83 additions & 79 deletions PolyvLiveScenesDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00DF09CC2682052700305ECA"
BuildableName = "PolyvLiveHiClassDemo.app"
BlueprintName = "PolyvLiveHiClassDemo"
ReferencedContainer = "container:PolyvLiveScenesDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00DF09CC2682052700305ECA"
BuildableName = "PolyvLiveHiClassDemo.app"
BlueprintName = "PolyvLiveHiClassDemo"
ReferencedContainer = "container:PolyvLiveScenesDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00DF09CC2682052700305ECA"
BuildableName = "PolyvLiveHiClassDemo.app"
BlueprintName = "PolyvLiveHiClassDemo"
ReferencedContainer = "container:PolyvLiveScenesDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ @interface PLVLiveStreamerLoginViewController () <UITextFieldDelegate>

@implementation PLVLiveStreamerLoginViewController

/// 开发时调试方法,该方法的代码修改不要提交
- (void)developerTest {
// 写死开发时的测试账号,优先级高于缓存于本地的账号信息
// 不需要时请注释掉,否则会覆盖本地缓存的账号信息
// self.tfChannelId.text = @"";
// self.tfPassword.text = @"";

// Bugly上报
[PLVBugReporter openWithType:PLVBuglyBundleTypeStreamer];
}

#pragma mark - [ Life Period ]

- (void)viewDidLoad {
Expand All @@ -58,8 +47,6 @@ - (void)viewDidLoad {
[self setupUI];

[self writeUserInfo];

[self developerTest];
}

- (void)viewWillLayoutSubviews {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@ @interface PLVLiveWatchLoginController ()

@implementation PLVLiveWatchLoginController

/// 开发时调试方法,该方法的代码修改不要提交
- (void)developerTest {
// 写死开发时的测试账号,优先级高于缓存于本地的账号信息。
// 不需要时请注释掉,否则会覆盖本地缓存的账号信息
// self.appIDTF.text = @"";
// self.userIDTF.text = @"";
// self.appSecretTF.text = @"";
// self.channelIdTF.text = @"";
// self.vIdTF.text = @"";

// Bugly上报
[PLVBugReporter openWithType:PLVBuglyBundleTypeWatch];
}

#pragma mark - Life Cycle

- (void)viewDidLoad {
Expand All @@ -71,8 +57,6 @@ - (void)viewDidLoad {

[self recoverParamsFromFile];

[self developerTest];

[self addNotification];

UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ NS_ASSUME_NONNULL_BEGIN
/// 开始/结束观看无延迟直播
- (void)startWatchNoDelay:(BOOL)startWatch;

/// 退出连麦(仅发送'退出连麦消息')
///
/// @note 此方法用于将当前 等待连麦 、正在加入连麦 或 连麦中的用户退出连麦
/// 仅发送退出连麦的soket消息,不关心是否真正退出RTC房间
/// 适用场景:当前确认 PLVLCLinkMicAreaView 或 内部的PLVLinkMicPresenter 将很快销毁,仅希望发送 ‘退出连麦’ 的请求消息,来更新本地用户在服务器中的状态
- (void)leaveLinkMicOnlyEmit;

@end

/// 连麦区域视图Delegate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ - (void)startWatchNoDelay:(BOOL)startWatch{
}
}

- (void)leaveLinkMicOnlyEmit {
[self.presenter leaveLinkMicOnlyEmit];
}

#pragma mark Getter
- (BOOL)inRTCRoom{
return self.presenter.inRTCRoom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ typedef NS_ENUM(NSUInteger, PLVLCLinkMicControlBarType) {
#pragma mark 状态
@property (nonatomic, assign) BOOL switchCameraButtonFront; // ’切换前后置摄像头按钮‘ 的当前前后置状态值 (NO:当前后置 YES:当前前置)
@property (nonatomic, assign) BOOL mediaControlButtonsShow; // 媒体控制按钮当前是否显示
@property (nonatomic, assign) BOOL cameraButtonEnable; // 摄像头按钮当前是否可点击(NO:当前分屏模式下视频连麦不可点击 YES:当前可点击)
@property (nonatomic, assign) PLVLCLinkMicControlBarStatus status; // 当前连麦控制栏的状态

#pragma mark 数据
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ @implementation PLVLCLinkMicLandscapeControlBar
@synthesize status = _status;
@synthesize switchCameraButtonFront = _switchCameraButtonFront;
@synthesize mediaControlButtonsShow = _mediaControlButtonsShow;
@synthesize cameraButtonEnable = _cameraButtonEnable;

@synthesize selfWidth = _selfWidth;
@synthesize selfHeight = _selfHeight;
Expand Down Expand Up @@ -181,10 +182,12 @@ - (void)refreshControlBarFrame{
CGFloat y = (CGRectGetMaxY(rangeRect) - self.selfHeight) / 2.0;
self.frame = CGRectMake(x, y, self.selfWidth, self.selfHeight);
[self setNeedsLayout];
[self shouldShowCameraEnableAlert];
}

- (void)synchControlBarState:(id<PLVLCLinkMicControlBarProtocol>)controlBar{
if (controlBar && controlBar != self) {
self.cameraButtonEnable = controlBar.cameraButtonEnable;
[self controlBarStatusSwitchTo:controlBar.status];
self.barType = controlBar.barType;
self.cameraButton.selected = controlBar.cameraButton.selected;
Expand All @@ -204,6 +207,10 @@ - (void)showSelfViewWithAnimation:(BOOL)show{
}

- (void)changeCameraButtonOpenUIWithoutEvent:(BOOL)toCameraOpen{
if (!self.cameraButtonEnable && toCameraOpen) {
[self cameraButtonAction:self.cameraButton];
return;
}
self.cameraButton.selected = !toCameraOpen;
BOOL currentOpen = !self.cameraButton.selected;
self.switchCameraButton.selected = !currentOpen;
Expand Down Expand Up @@ -257,6 +264,7 @@ - (void)resetButtons{
_switchCameraButton.selected = !PLVLCLinkMicControlBarCameraDefaultOpen;
_switchCameraButtonFront = PLVLCLinkMicControlBarSwitchCameraDefaultFront;
_micButton.selected = !PLVLCLinkMicControlBarMicDefaultOpen;
_cameraButtonEnable = YES;
}

- (void)refreshBackgroudViewFrame{
Expand Down Expand Up @@ -426,14 +434,36 @@ - (void)textLabelShow:(BOOL)show{
}];
}

/// 判断是否显示分屏模式下不能使用摄像头的提醒
- (void)shouldShowCameraEnableAlert {
BOOL isPad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
if (isPad) {
BOOL isSplitView = UIViewGetWidth(self.superview) < [UIScreen mainScreen].bounds.size.width;
if (isSplitView && self.cameraButtonEnable && self.status == PLVLCLinkMicControlBarStatus_Joined && self.barType == PLVLCLinkMicControlBarType_Video) {
if (!self.cameraButton.selected) {
[self cameraButtonAction:self.cameraButton];
[PLVLCUtils showHUDWithTitle:nil detail:@"分屏模式下无法使用摄像头,已自动关闭摄像头" view:self.superview afterDelay:3.0];
} else {
[PLVLCUtils showHUDWithTitle:nil detail:@"分屏模式下无法使用摄像头,已自动禁用摄像头" view:self.superview afterDelay:3.0];
}
self.cameraButtonEnable = NO;
self.cameraButton.userInteractionEnabled = NO;
} else if (!isSplitView || self.status != PLVLCLinkMicControlBarStatus_Joined) {
self.cameraButtonEnable = YES;
self.cameraButton.userInteractionEnabled = YES;
self.cameraButton.alpha = (self.status == PLVLCLinkMicControlBarStatus_Joined && self.barType == PLVLCLinkMicControlBarType_Video) ? 1.0 : 0.0;
}
}
}

/// 控制系列按钮 显示或隐藏动画
- (void)mediaControlButtonsShow:(BOOL)show{
_mediaControlButtonsShow = show;
self.tapGR.enabled = !show;
CGFloat alpha = show ? 1.0 : 0.0;
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:PLVLCLinkMicControlBar_CommonTime animations:^{
weakSelf.cameraButton.alpha = alpha;
weakSelf.cameraButton.alpha = weakSelf.cameraButtonEnable ? alpha : 0.5;
weakSelf.switchCameraButton.alpha = show ? (weakSelf.switchCameraButton.selected ? 0.5 : 1.0) : 0.0;
weakSelf.micButton.alpha = alpha;
}];
Expand Down Expand Up @@ -463,7 +493,7 @@ - (void)notifyListenerOnOffButtonClickedCurrentStatus {

- (void)cameraButtonAction:(UIButton *)button{
button.enabled = NO;
BOOL wannaOpen = self.cameraButton.selected;
BOOL wannaOpen = self.cameraButton.selected && self.cameraButtonEnable;
if ([self.delegate respondsToSelector:@selector(plvLCLinkMicControlBar:cameraButtonClicked:openResult:)]) {
__weak typeof(self) weakSelf = self;
[self.delegate plvLCLinkMicControlBar:self cameraButtonClicked:wannaOpen openResult:^(BOOL openResult) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ @implementation PLVLCLinkMicPortraitControlBar
@synthesize status = _status;
@synthesize switchCameraButtonFront = _switchCameraButtonFront;
@synthesize mediaControlButtonsShow = _mediaControlButtonsShow;
@synthesize cameraButtonEnable = _cameraButtonEnable;

@synthesize selfWidth = _selfWidth;
@synthesize selfHeight = _selfHeight;
Expand Down Expand Up @@ -215,10 +216,12 @@ - (void)refreshControlBarFrame{
[self setNeedsLayout];

if (firstLayout) { self.lastPoint = self.bounds.origin; }
[self shouldShowCameraEnableAlert];
}

- (void)synchControlBarState:(id<PLVLCLinkMicControlBarProtocol>)controlBar{
if (controlBar && controlBar != self) {
self.cameraButtonEnable = controlBar.cameraButtonEnable;
[self controlBarStatusSwitchTo:controlBar.status];
self.barType = controlBar.barType;
self.cameraButton.selected = controlBar.cameraButton.selected;
Expand All @@ -238,6 +241,10 @@ - (void)showSelfViewWithAnimation:(BOOL)show{
}

- (void)changeCameraButtonOpenUIWithoutEvent:(BOOL)toCameraOpen{
if (!self.cameraButtonEnable && toCameraOpen) {
[self cameraButtonAction:self.cameraButton];
return;
}
self.cameraButton.selected = !toCameraOpen;
BOOL currentOpen = !self.cameraButton.selected;
self.switchCameraButton.selected = !currentOpen;
Expand Down Expand Up @@ -296,6 +303,7 @@ - (void)resetButtons{
_switchCameraButton.selected = !PLVLCLinkMicControlBarCameraDefaultOpen;
_switchCameraButtonFront = PLVLCLinkMicControlBarSwitchCameraDefaultFront;
_micButton.selected = !PLVLCLinkMicControlBarMicDefaultOpen;
_cameraButtonEnable = YES;
}

- (void)setBackgroudViewWidth{
Expand Down Expand Up @@ -565,14 +573,36 @@ - (void)textLabelShow:(BOOL)show{
}];
}

/// 判断是否显示分屏模式下不能使用摄像头的提醒
- (void)shouldShowCameraEnableAlert {
BOOL isPad = ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad);
if (isPad) {
BOOL isSplitView = UIViewGetWidth(self.superview) < [UIScreen mainScreen].bounds.size.width;
if (isSplitView && self.cameraButtonEnable && self.status == PLVLCLinkMicControlBarStatus_Joined && self.barType == PLVLCLinkMicControlBarType_Video) {
if (!self.cameraButton.selected) {
[self cameraButtonAction:self.cameraButton];
[PLVLCUtils showHUDWithTitle:nil detail:@"分屏模式下无法使用摄像头,已自动关闭摄像头" view:self.superview afterDelay:3.0];
} else {
[PLVLCUtils showHUDWithTitle:nil detail:@"分屏模式下无法使用摄像头,已自动禁用摄像头" view:self.superview afterDelay:3.0];
}
self.cameraButtonEnable = NO;
self.cameraButton.userInteractionEnabled = NO;
} else if (!isSplitView || self.status != PLVLCLinkMicControlBarStatus_Joined) {
self.cameraButtonEnable = YES;
self.cameraButton.userInteractionEnabled = YES;
self.cameraButton.alpha = (self.status == PLVLCLinkMicControlBarStatus_Joined && self.barType == PLVLCLinkMicControlBarType_Video) ? 1.0 : 0.0;
}
}
}

/// 控制系列按钮 显示或隐藏动画
- (void)mediaControlButtonsShow:(BOOL)show{
_mediaControlButtonsShow = show;
self.tapGR.enabled = !show;
CGFloat alpha = show ? 1.0 : 0.0;
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:PLVLCLinkMicControlBar_ShiftTime animations:^{
weakSelf.cameraButton.alpha = alpha;
weakSelf.cameraButton.alpha = weakSelf.cameraButtonEnable ? alpha : 0.5;
weakSelf.switchCameraButton.alpha = show ? (weakSelf.switchCameraButton.selected ? 0.5 : 1.0) : 0.0;
weakSelf.micButton.alpha = alpha;
weakSelf.hideButton.alpha = alpha;
Expand Down Expand Up @@ -655,7 +685,7 @@ - (void)notifyListenerOnOffButtonClickedCurrentStatus {
- (void)cameraButtonAction:(UIButton *)button{
[self startHideSelfViewTimer];
button.enabled = NO;
BOOL wannaOpen = self.cameraButton.selected;
BOOL wannaOpen = self.cameraButton.selected && self.cameraButtonEnable;;
if ([self.delegate respondsToSelector:@selector(plvLCLinkMicControlBar:cameraButtonClicked:openResult:)]) {
__weak typeof(self) weakSelf = self;
[self.delegate plvLCLinkMicControlBar:self cameraButtonClicked:wannaOpen openResult:^(BOOL openResult) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ - (void)layoutSubviews{
[self windowCellCornerShow:fullScreen];
}


#pragma mark - [ Public Methods ]
- (void)setModel:(PLVLinkMicOnlineUser *)userModel{
// 设置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ - (void)reloadLinkMicUserWindowsWithCompleteBlock:(void (^)(void))reloadComplete
if (firstSiteOnlineUser) {
[self checkUserModelAndSetupLinkMicCanvasView:firstSiteOnlineUser];
[self setupUserModelWillDeallocBlock:firstSiteOnlineUser];
/// 在纯视频场景下主屏需要额外设置 ’摄像头是否应该显示值‘ 的回调
firstSiteOnlineUser.cameraShouldShowChangedBlock = ^(PLVLinkMicOnlineUser * _Nonnull onlineUser) {
[onlineUser.canvasView rtcViewShow:onlineUser.currentCameraShouldShow];
};

if ([self.delegate respondsToSelector:@selector(plvLCLinkMicWindowsView:showFirstSiteCanvasViewOnExternal:)]) {
[self.delegate plvLCLinkMicWindowsView:self showFirstSiteCanvasViewOnExternal:firstSiteOnlineUser.canvasView];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,26 @@ - (void)refreshTitleLabelFrameInSmallScreen{
CGSize backButtonSize = CGSizeMake(40.0, 20.0);
CGFloat topPadding = isPad ? 30.0 : 16.0;
CGSize titleLabelFitSize = [self.titleLabel sizeThatFits:CGSizeMake(200, 22)];
CGFloat titleLabelWidth = CGRectGetMinX(self.moreButton.frame) - CGRectGetMaxX(self.backButton.frame);

if (isPad) {
// iPad小分屏适配(横屏1:2),标题宽度调整,观看次数隐藏
Boolean isSmallScreen = CGRectGetWidth(self.bounds) <= PLVScreenWidth / 3 ? YES : NO;
if (isSmallScreen) {
self.playTimesLabel.hidden = YES;

CGFloat titleLabelWidth = CGRectGetMinX(self.bulletinButton.frame) - CGRectGetMaxX(self.backButton.frame);
if (self.skinViewType < PLVLCBasePlayerSkinViewType_AlonePlayback) {
titleLabelWidth = CGRectGetMinX(self.bulletinButton.frame) - CGRectGetMaxX(self.backButton.frame);
}
titleLabelWidth = MIN(titleLabelWidth, titleLabelFitSize.width);
self.titleLabel.frame = CGRectMake(CGRectGetMaxX(self.backButton.frame), topPadding, titleLabelWidth, backButtonSize.height);
} else {
self.playTimesLabel.hidden = NO;

CGFloat playTimesLabelMaxWidth = 100;
CGFloat titleLabelWidth = CGRectGetMinX(self.bulletinButton.frame) - CGRectGetMaxX(self.backButton.frame) - playTimesLabelMaxWidth - 16;
if (self.skinViewType < PLVLCBasePlayerSkinViewType_AlonePlayback) {
titleLabelWidth = CGRectGetMinX(self.bulletinButton.frame) - CGRectGetMaxX(self.backButton.frame) - playTimesLabelMaxWidth - 16;
}
titleLabelWidth = MIN(titleLabelWidth, titleLabelFitSize.width);
self.titleLabel.frame = CGRectMake(CGRectGetMaxX(self.backButton.frame), topPadding, titleLabelWidth, backButtonSize.height);
}
Expand Down
Loading

0 comments on commit 64fd206

Please sign in to comment.