Skip to content

Commit

Permalink
提交 1.8.2 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
hjw1556 committed Feb 28, 2022
1 parent 875e0e6 commit 64c82f1
Show file tree
Hide file tree
Showing 171 changed files with 7,330 additions and 2,104 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.8.1'
pod 'PLVLiveScenesSDK', '1.8.2'

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

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ - (void)viewDidLoad {

- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];

CGFloat bottomPadding = 0;
if (@available(iOS 11.0, *)) {
bottomPadding = self.view.safeAreaInsets.bottom;
}
self.studentBackgroundImageView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), 292);
self.studentBackgroundImageView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) * 0.36);
self.backButton.frame = CGRectMake(24, 53, 36, 36);
CGFloat viewOriginY = CGRectGetMaxY(self.studentBackgroundImageView.frame) - 42;
self.courseOrLessonLoginView.frame = CGRectMake(0, viewOriginY, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds) - viewOriginY);
Expand Down Expand Up @@ -173,6 +172,7 @@ - (void)removeKeyboardEvents {
- (UIImageView *)studentBackgroundImageView {
if (!_studentBackgroundImageView) {
_studentBackgroundImageView = [[UIImageView alloc] initWithImage:[PLVHCDemoUtils imageForHiClassResource:@"plvhc_student_bg_image"]];
_studentBackgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _studentBackgroundImageView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ - (void)keyboardWillHide:(NSNotification *)notification {
- (UIImageView *)studentBackgroundImageView {
if (!_studentBackgroundImageView) {
_studentBackgroundImageView = [[UIImageView alloc] initWithImage:[PLVHCDemoUtils imageForHiClassResource:@"plvhc_student_bg_image"]];
_studentBackgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _studentBackgroundImageView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,35 +95,45 @@ - (void)viewDidLoad {

- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];

self.teacherBackgroundImageView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) / 2.88);
BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
CGFloat left = 34;
CGFloat top = 33;
CGFloat loginButtonLeft = 24;
CGFloat rememberAccountButtonLeft = 63;
if (isPad) {
left = 203;
top = 88;
loginButtonLeft = 202;
rememberAccountButtonLeft = 202;
}
self.teacherBackgroundImageView.frame = CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) * 0.36);
self.backButton.frame = CGRectMake(24, 53, 36, 36);

self.contentView.frame = CGRectMake(0, CGRectGetMaxY(self.teacherBackgroundImageView.frame) - 42, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame) - CGRectGetHeight(self.teacherBackgroundImageView.frame) + 42);
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.contentView.bounds byRoundingCorners:UIRectCornerTopLeft cornerRadii:CGSizeMake(40,40)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.contentView.bounds;
maskLayer.path = maskPath.CGPath;
self.contentView.layer.mask = maskLayer;

self.titleLabel.frame = CGRectMake(34, 33, 104, 37);
self.titleLabel.frame = CGRectMake(left, top, 104, 37);
self.titleImageView.frame = CGRectMake(CGRectGetMaxX(self.titleLabel.frame) + 10, CGRectGetMidY(self.titleLabel.frame) - 24 / 2, 48, 24);
self.chooseAreaCodeButton.frame = CGRectMake(34, CGRectGetMaxY(self.titleLabel.frame) + 38, 65, 40);
self.accountLine.frame = CGRectMake(34, CGRectGetMaxY(self.chooseAreaCodeButton.frame) + 5, CGRectGetWidth(self.view.frame) - 34 * 2, 1);
self.chooseAreaCodeButton.frame = CGRectMake(left, CGRectGetMaxY(self.titleLabel.frame) + 38, 65, 40);
self.accountLine.frame = CGRectMake(left, CGRectGetMaxY(self.chooseAreaCodeButton.frame) + 5, CGRectGetWidth(self.view.frame) - left * 2, 1);
self.areaCodeLabel.frame = CGRectMake(0, 0, 45, 40);
self.accountTextField.frame = CGRectMake(CGRectGetMaxX(self.chooseAreaCodeButton.frame) + 10, CGRectGetMaxY(self.titleLabel.frame) + 38, CGRectGetWidth(self.view.frame) - 34 - CGRectGetMaxX(self.chooseAreaCodeButton.frame) - 10, 40);
self.accountTextField.frame = CGRectMake(CGRectGetMaxX(self.chooseAreaCodeButton.frame) + 10, CGRectGetMaxY(self.titleLabel.frame) + 38, CGRectGetWidth(self.view.frame) - left - CGRectGetMaxX(self.chooseAreaCodeButton.frame) - 10, 40);
self.arrowImageView.frame = CGRectMake(CGRectGetMaxX(self.areaCodeLabel.frame) + 3, CGRectGetMidY(self.areaCodeLabel.frame) - 11 / 2, 12, 11);
self.areaCodeLine.frame = CGRectMake(CGRectGetMaxX(self.chooseAreaCodeButton.frame) + 5, CGRectGetMidY(self.chooseAreaCodeButton.frame) - 8, 1, 16);

self.passwordTextField.frame = CGRectMake(34, CGRectGetMaxY(self.accountLine.frame) + 38, CGRectGetWidth(self.view.frame) - 34 * 2 - 45, 40);
self.passwordLine.frame = CGRectMake(34, CGRectGetMaxY(self.passwordTextField.frame) + 5, CGRectGetWidth(self.view.frame) - 34 * 2, 1);
self.passwordTextField.frame = CGRectMake(left, CGRectGetMaxY(self.accountLine.frame) + 38, CGRectGetWidth(self.view.frame) - left * 2 - 45, 40);
self.passwordLine.frame = CGRectMake(left, CGRectGetMaxY(self.passwordTextField.frame) + 5, CGRectGetWidth(self.view.frame) - left * 2, 1);
self.showPasswordButton.frame = CGRectMake(CGRectGetMaxX(self.passwordLine.frame) - 12 - 20, CGRectGetMidY(self.passwordTextField.frame) - 18 / 2, 20, 18);


self.loginButton.frame = CGRectMake(24, CGRectGetMaxY(self.passwordLine.frame) + 37, CGRectGetWidth(self.view.frame) - 24 * 2, 50);
self.loginButton.frame = CGRectMake(loginButtonLeft, CGRectGetMaxY(self.passwordLine.frame) + 37, CGRectGetWidth(self.view.frame) - loginButtonLeft * 2, 50);
self.gradientLayer.frame = self.loginButton.bounds;

self.rememberAccountButton.frame = CGRectMake(CGRectGetMidX(self.contentView.frame) - 100, CGRectGetMaxY(self.loginButton.frame) + 24, 16, 16);
self.rememberAccountButton.frame = CGRectMake(rememberAccountButtonLeft, CGRectGetMaxY(self.loginButton.frame) + (isPad ? 49 : 24), 16, 16);
self.rememberAccountLabel.frame = CGRectMake(CGRectGetMaxX(self.rememberAccountButton.frame) + 4, CGRectGetMidY(self.rememberAccountButton.frame) - 32 / 2, 200, 32);

self.agreementButton.frame = CGRectMake(CGRectGetMinX(self.rememberAccountButton.frame), CGRectGetMaxY(self.rememberAccountButton.frame) + 18, 16, 16);
Expand Down Expand Up @@ -361,6 +371,7 @@ - (void)removeKeyboardEvents {
- (UIImageView *)teacherBackgroundImageView {
if (!_teacherBackgroundImageView) {
_teacherBackgroundImageView = [[UIImageView alloc] initWithImage:[PLVHCDemoUtils imageForHiClassResource:@"plvhc_teacher_bg_image"]];
_teacherBackgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _teacherBackgroundImageView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ - (void)layoutSubviews {
bottomPadding = self.safeAreaInsets.bottom;
}

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
topPadding = self.bounds.size.height * 0.288;
}

self.topTitleView.frame = CGRectMake(0, topPadding, self.bounds.size.width, 64);
self.topTitleView.layer.mask = self.topTitleViewLayer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,25 @@ - (instancetype)initWithType:(PLVHCStudentLoginViewType)type {

- (void)layoutSubviews {
[super layoutSubviews];

BOOL isPad = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
CGFloat left = 34;
CGFloat top = 33;
CGFloat loginButtonLeft = 24;
CGFloat agreementButtonLeft = 105;
if (isPad) {
left = 203;
top = 88;
loginButtonLeft = 202;
agreementButtonLeft = 202;
}
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:UIRectCornerTopLeft cornerRadii:CGSizeMake(40,40)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.bounds;
maskLayer.path = maskPath.CGPath;
self.layer.mask = maskLayer;
self.titleLabel.frame = CGRectMake(34, 33, 104, 37);
self.titleLabel.frame = CGRectMake(left, top, 104, 37);
self.titleImageView.center = CGPointMake(CGRectGetMaxX(self.titleLabel.frame) + 10 + CGRectGetWidth(self.titleImageView.bounds)/2, CGRectGetMidY(self.titleLabel.frame));
self.textField.frame = CGRectMake(34, CGRectGetMaxY(self.titleLabel.frame) + 42, CGRectGetWidth(self.bounds) - 34 * 2, 40);
self.textField.frame = CGRectMake(left, CGRectGetMaxY(self.titleLabel.frame) + 42, CGRectGetWidth(self.bounds) - left * 2, 40);
self.textFieldLine.frame = CGRectMake(CGRectGetMinX(self.textField.frame), CGRectGetMaxY(self.textField.frame) + 5, CGRectGetWidth(self.textField.bounds), 1);

if (_viewType == PLVHCStudentLoginViewType_CourseOrLesson) {
Expand All @@ -67,7 +77,11 @@ - (void)layoutSubviews {
bottomPadding = self.superview.safeAreaInsets.bottom;
}
}
self.agreementButton.frame = CGRectMake(105, CGRectGetMaxY(self.bounds) - bottomPadding - 20 - 16, 16, 16);
if (isPad) {
self.agreementButton.frame = CGRectMake(agreementButtonLeft, CGRectGetMaxY(self.loginButton.frame) + 42, 16, 16);
} else {
self.agreementButton.frame = CGRectMake(agreementButtonLeft, CGRectGetMaxY(self.bounds) - bottomPadding - 20 - 16, 16, 16);
}
self.agreementLabel.frame = CGRectMake(CGRectGetMaxX(self.agreementButton.frame) + 4, CGRectGetMidY(self.agreementButton.frame) - 32 / 2, 75, 32);
self.readAgreementButton.frame = CGRectMake(CGRectGetMaxX(self.agreementLabel.frame), CGRectGetMinY(self.agreementLabel.frame), 80, 32);
} else if (_viewType == PLVHCStudentLoginViewType_Code) {
Expand All @@ -76,7 +90,8 @@ - (void)layoutSubviews {
self.textField.frame = CGRectMake(CGRectGetMinX(self.passwordTextField.frame), CGRectGetMaxY(self.passwordTextFieldLine.frame) + 42, CGRectGetWidth(self.passwordTextField.bounds), CGRectGetHeight(self.passwordTextField.bounds));
self.textFieldLine.frame = CGRectMake(CGRectGetMinX(self.textField.frame), CGRectGetMaxY(self.textField.frame) + 5, CGRectGetWidth(self.textField.bounds), 1);
}
self.loginButton.frame = CGRectMake(24, CGRectGetMaxY(self.textFieldLine.frame) + 48, CGRectGetWidth(self.bounds) - 24 * 2, 50);

self.loginButton.frame = CGRectMake(loginButtonLeft, CGRectGetMaxY(self.textFieldLine.frame) + 48, CGRectGetWidth(self.bounds) - loginButtonLeft * 2, 50);
[self.loginButton setBackgroundImage:[self createImageWithColorSize:self.loginButton.bounds.size isGradient:YES] forState:UIControlStateNormal];
}

Expand All @@ -95,18 +110,22 @@ - (void)setUpUI {
[self addSubview:self.readAgreementButton];
self.titleLabel.text = @"登录课程";
_textField.attributedPlaceholder = [self placeholderAttributedStringWithString:@"请输入课程号 / 课节号"];
[_loginButton setTitle:@"登录" forState:UIControlStateNormal];
} else if (_viewType == PLVHCStudentLoginViewType_Null) {
self.titleLabel.text = @"设置名称";
_textField.attributedPlaceholder = [self placeholderAttributedStringWithString:@"请设置你的名称"];
[_loginButton setTitle:@"下一步" forState:UIControlStateNormal];
} else if(_viewType == PLVHCStudentLoginViewType_WhiteList) {
self.titleLabel.text = @"学生码";
_textField.attributedPlaceholder = [self placeholderAttributedStringWithString:@"请输入学生码"];
[_loginButton setTitle:@"下一步" forState:UIControlStateNormal];
} else if(_viewType == PLVHCStudentLoginViewType_Code) {
[self addSubview:self.passwordTextField];
[self.layer addSublayer:self.passwordTextFieldLine];
self.titleLabel.text = @"验证信息";
_passwordTextField.attributedPlaceholder = [self placeholderAttributedStringWithString:@"请输入密码"];
_textField.attributedPlaceholder = [self placeholderAttributedStringWithString:@"请设置你的名称"];
[_loginButton setTitle:@"下一步" forState:UIControlStateNormal];
}
}

Expand Down Expand Up @@ -275,6 +294,7 @@ - (void)agreementButtonAction:(UIButton *)sender {
}

- (void)loginButtonAction {
[self.textField endEditing:YES];
if (self.delegate && [self.delegate respondsToSelector:@selector(studentLoginViewLoginSelected:)]) {
[self.delegate studentLoginViewLoginSelected:self];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ - (BOOL)initParams:(BOOL)live {
!self.channelIdTF.text || self.channelIdTF.text.length == 0) {
return NO;
}
if (!live && (!self.vIdTF.text || self.vIdTF.text.length == 0)) {
return NO;
}
return YES;
}

Expand Down Expand Up @@ -344,6 +341,7 @@ - (void)loginCloudClassPlaybackRoomWithChannelType:(PLVChannelType)channelType
__weak typeof(self)weakSelf = self;
[PLVRoomLoginClient loginPlaybackRoomWithChannelType:channelType
channelId:self.channelIdTF.text
vodList:self.vodListSwitch.isOn
vid:self.vIdTF.text
userId:self.userIDTF.text
appId:self.appIDTF.text
Expand All @@ -361,9 +359,6 @@ - (void)loginCloudClassPlaybackRoomWithChannelType:(PLVChannelType)channelType
return;
}
[weakSelf saveParamsToFile];
/// 可在此处配置 ‘点播列表’ 开关
/// YES:请求 ‘点播列表’ 视频,NO:请求非 ‘点播列表’ 视频
[PLVRoomDataManager sharedManager].roomData.vodList = weakSelf.vodListSwitch.isOn;

if (successHandler) {
successHandler();
Expand Down Expand Up @@ -413,6 +408,7 @@ - (void)loginEcommercePlaybackRoomWithChannelType:(PLVChannelType)channelType
__weak typeof(self)weakSelf = self;
[PLVRoomLoginClient loginPlaybackRoomWithChannelType:channelType
channelId:self.channelIdTF.text
vodList:self.vodListSwitch.isOn
vid:self.vIdTF.text
userId:self.userIDTF.text
appId:self.appIDTF.text
Expand All @@ -425,9 +421,6 @@ - (void)loginEcommercePlaybackRoomWithChannelType:(PLVChannelType)channelType
} completion:^(PLVViewLogCustomParam * _Nonnull customParam) {
[hud hideAnimated:YES];
[weakSelf saveParamsToFile];
/// 可在此处配置 ‘点播列表’ 开关
/// YES:请求 ‘点播列表’ 视频,NO:请求非 ‘点播列表’ 视频
[PLVRoomDataManager sharedManager].roomData.vodList = weakSelf.vodListSwitch.isOn;

if (successHandler) {
successHandler();
Expand All @@ -436,6 +429,7 @@ - (void)loginEcommercePlaybackRoomWithChannelType:(PLVChannelType)channelType
[hud hideAnimated:YES];
[weakSelf showHud:errorMessage detail:nil];
}];

}

#pragma mark - 读写缓存账号信息
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 当前 是否连麦中 (YES:正在连麦中 NO:不在连麦中)
@property (nonatomic, assign, readonly) BOOL inLinkMic;

/// 当前 是否已暂停无延迟观看(YES:已暂停 NO:未暂停)
@property (nonatomic, assign, readonly) BOOL pausedWatchNoDelay;

/// 当前 是否显示连麦区域视图
///
/// @note 代表的是 ”用户的主观意愿 是否希望连麦区域视图显示“;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ - (BOOL)inLinkMic{
}


- (BOOL)pausedWatchNoDelay {
return self.presenter.pausedWatchNoDelay;
}

#pragma mark - [ Private Methods ]
- (void)setup{
// 添加 连麦功能模块
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ - (void)shouldShowCameraEnableAlert {
} 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;
self.cameraButton.alpha = (self.status == PLVLCLinkMicControlBarStatus_Joined && self.barType == PLVLCLinkMicControlBarType_Video && !_foldSelf) ? 1.0 : 0.0;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ - (void)layoutSubviews{
// 横屏

selfWidth = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 180.0 : 150.0;
self.collectionView.frame = CGRectMake(8, 0, selfWidth, selfHeight);
CGFloat originX = [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ? 15 : 8;
self.collectionView.frame = CGRectMake(originX, 0, selfWidth, selfHeight);
self.collectionView.alwaysBounceHorizontal = NO;
self.collectionView.alwaysBounceVertical = YES;

Expand All @@ -105,12 +106,14 @@ - (void)layoutSubviews{

[self showGuideView];
}
[self.collectionView setCollectionViewLayout:self.collectionViewLayout animated:YES];

if (selfHeight > 0 && self.collectionReloadBlock) {
self.collectionReloadBlock();
self.collectionReloadBlock = nil;
}

[self.collectionView.collectionViewLayout invalidateLayout];
[self.collectionView setCollectionViewLayout:self.collectionViewLayout animated:YES];
}

- (void)layoutGuideView{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ typedef NS_ENUM(NSUInteger, PLVLCMediaAreaViewLiveSceneType) {
@property (nonatomic, assign) CGFloat topPaddingBelowiOS11;

#pragma mark 状态
/// 当前播放时间
@property (nonatomic, assign, readonly) NSTimeInterval currentPlayTime;

/// 当前播放器类型
///
/// @note 可通过 [switchAreaViewLiveSceneTypeTo:] 方法进行切换;仅适用在视频类型为 ‘直播’ 时使用此类型值
Expand Down Expand Up @@ -136,6 +139,9 @@ typedef NS_ENUM(NSUInteger, PLVLCMediaAreaViewLiveSceneType) {
/// 因此以下该“对外方法”,仅应该在 连麦场景中 被调用。
- (UIView *)getContentViewForExchange;

/// 视频跳至某个时间点
- (void)seekLivePlaybackToTime:(NSTimeInterval)time;

/// 显示网络不佳提示视图
- (void)showNetworkQualityMiddleView;

Expand All @@ -160,6 +166,15 @@ typedef NS_ENUM(NSUInteger, PLVLCMediaAreaViewLiveSceneType) {
/// @return BOOL 由外部告知的当前是否连麦中 (YES:正在连麦中 NO:不在连麦中)
- (BOOL)plvLCMediaAreaViewGetInLinkMic:(PLVLCMediaAreaView *)mediaAreaView;

/// 媒体区域视图需要得知当前‘是否暂停无延迟观看’
///
/// @note 此回调不保证在主线程触发
///
/// @param mediaAreaView 媒体区域视图
///
/// @return BOOL 由外部告知的当前是否已暂停无延迟观看 (YES:已暂停 NO:未暂停)
- (BOOL)plvLCMediaAreaViewGetPausedWatchNoDelay:(PLVLCMediaAreaView *)mediaAreaView;

/// 媒体区域视图需要得知当前‘是否在RTC房间中’
///
/// @note 此回调不保证在主线程触发
Expand Down
Loading

0 comments on commit 64c82f1

Please sign in to comment.