Commit e01c0b42 authored by 代凡's avatar 代凡
Browse files

Merge remote-tracking branch 'origin/develop' into develop

parents af033f95 985b936b
# RN 云课堂集成文档
## 1. 概述
......@@ -116,9 +115,9 @@ $ npm install
| 函数名 | 参数 | 功能说明 | 是否有返回值 |
| :------------ | ------------------------------------------------------------ | ---------------- | ------------ |
| init | vodKey:加密串(必填)<br/>decodeKey:加密密钥(必填)<br/>decodeIv:加密向量(必填)<br/>viewerId:观看者 ID(填)<br/>nickName:观看者昵称(选填) | 获取视频码率列表 | 是 |
| liveLogin | userId:账号 ID(必填)<br/>channelId:频道号(必填)<br/>appId:应用 ID(必填)<br/>appSecret:应用密钥(必填) | 开始下载视频 | 是 |
| playbackLogin | userId:账号 ID(必填)<br/>channelId:频道号(必填)<br/>vodId:回放视频 ID(必填)<br/>appId:应用 ID(必填)<br/>appSecret:应用密钥(必填) | 暂停下载 | 是 |
| init | vodKey:加密串(必填)<br/>decodeKey:加密密钥(必填)<br/>decodeIv:加密向量(必填)<br/>viewerId:观看者 ID(填)<br/>nickName:观看者昵称(选填) | SDK 初始化 | 是 |
| liveLogin | userId:账号 ID(必填)<br/>channelId:频道号(必填)<br/>appId:应用 ID(必填)<br/>appSecret:应用密钥(必填) | 直播登录 | 是 |
| playbackLogin | userId:账号 ID(必填)<br/>channelId:频道号(必填)<br/>vodId:回放视频 ID(必填)<br/>appId:应用 ID(必填)<br/>appSecret:应用密钥(必填) | 回放登录 | 是 |
以上函数的返回值参见 2.1.5。
......@@ -129,7 +128,7 @@ $ npm install
| 0 | 成功 |
| -1 | appId 为空 |
| -2 | appSecret 为空 |
| -3 | ViewId 为空 |
| -3 | viewerId 为空 |
| -4 | userId 为空 |
| -5 | channelId 为空 |
| -6 | vodId 为空 |
......@@ -167,7 +166,45 @@ include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
```
工程的相关依赖配置:build.gradle
主工程下依赖配置:build.gradle
```java
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url "https://jitpack.io" }
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
//polyv依赖配置
maven { url 'https://dl.bintray.com/polyv/abn' }
}
}
//相关系统依赖版本
ext {
supportLibVersion = "27.1.1"
compileSdkVersion = 27
minSdkVersion = 16
targetSdkVersion = 27
versionCode = 8202
versionName = "0.8.2.02"
}
```
app工程的相关依赖配置:build.gradle
```java
dependencies {
......
......@@ -4,11 +4,10 @@ target 'PolyvRNCloudClassDemo' do
use_frameworks!
pod 'Masonry', '~> 1.1.0'
pod 'SDWebImage', '~> 4.4.0'
pod 'PolyvCloudClassSDK', '0.9.0-beta'
pod 'SDWebImage', '4.4.0'
pod 'PolyvCloudClassSDK', '0.9.0'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
#pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
#pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
end
......@@ -14,17 +14,17 @@
self = [super initWithFrame:frame];
if (self) {
CGFloat width = 100.0;
CGFloat height = 44.0;
//CGFloat height = 44.0;
self.frame = CGRectMake(frame.origin.x, frame.origin.y, width, height);
self.frame = CGRectMake(frame.origin.x, frame.origin.y, width, frame.size.height);
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, height)];
_titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, width, frame.size.height)];
_titleLabel.textColor = [UIColor darkGrayColor];
_titleLabel.font = [UIFont systemFontOfSize:16];
_titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:_titleLabel];
_indicatorView = [[UIView alloc] initWithFrame:CGRectMake(34, 41, 32, 3)];
_indicatorView = [[UIView alloc] initWithFrame:CGRectMake(34, frame.size.height - 3, 32, 3)];
_indicatorView.backgroundColor = [UIColor colorWithRed:0x21/255.0 green:0x96/255.0 blue:0xf3/255.0 alpha:1.0];
[self addSubview:_indicatorView];
_indicatorView.hidden = YES;
......
......@@ -25,7 +25,7 @@ UIColor *ViewBackgroupColor;
- (void)viewDidLoad {
[super viewDidLoad];
if ([UIScreen mainScreen].bounds.size.height == 812) {
if ([UIScreen mainScreen].bounds.size.height >= 812) {
ToolbarHeight = 84.0;
LimitMemeory = 1024 * 1024 * 120;
MemeoryLarge = 1024 * 1024 * 80;
......
......@@ -13,12 +13,13 @@ NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, PolyvCloudClassErrorCode) {
PolyvCloudClassError_Success = 0,
PolyvCloudClassError_NoAppId = -4,
PolyvCloudClassError_NoAppSecret = -5,
PolyvCloudClassError_NoUserId = -6,
PolyvCloudClassError_NoChannelId = -7,
PolyvCloudClassError_NoVodId = -8,
PolyvCloudClassError_LoginFailed = -9,
PolyvCloudClassError_NoAppId = -1,
PolyvCloudClassError_NoAppSecret = -2,
PolyvCloudClassError_NoViewerId = -3,
PolyvCloudClassError_NoUserId = -4,
PolyvCloudClassError_NoChannelId = -5,
PolyvCloudClassError_NoVodId = -6,
PolyvCloudClassError_LoginFailed = -10,
};
@interface PolyvRNCloudClassLoginModule : NSObject <RCTBridgeModule>
......
......@@ -47,7 +47,7 @@ RCT_EXPORT_MODULE();
// 参数 vodKey (选填)
// 参数 decodeKey (选填)
// 参数 decodeIv(选填)
// 参数 viewerId(填)
// 参数 viewerId(填)
// 参数 nickName(选填)
RCT_EXPORT_METHOD(
init:(NSString *)vodKey
......@@ -62,9 +62,16 @@ RCT_EXPORT_METHOD(
NSLog(@"init() - %@ 、 %@ 、 %@ 、 %@ 、 %@", vodKey, decodeKey, decodeIv, viewerId, nickName);
RCTLogInfo(@"init() - %@ 、 %@ 、 %@ 、 %@、 %@", vodKey, decodeKey, decodeIv, viewerId, nickName);
// 配置统计后台参数:用户Id、用户昵称及自定义参数
[PLVLiveVideoConfig setViewLogParam:viewerId param2:nickName param4:nil param5:nil];
resolve(@[@(PolyvCloudClassError_Success)]);
if (viewerId.length > 0) { // 配置统计后台参数:用户Id、用户昵称及自定义参数
[PLVLiveVideoConfig setViewLogParam:viewerId param2:nickName param4:nil param5:nil];
resolve(@[@(PolyvCloudClassError_Success)]);
} else {
PolyvCloudClassErrorCode errorCode = PolyvCloudClassError_NoViewerId;
NSString *errorDesc = NSStringFromErrorCode(errorCode);
NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:errorCode userInfo:@{NSLocalizedDescriptionKey:errorDesc}];
NSLog(@"%@", errorDesc);
reject([@(errorCode) stringValue], errorDesc, error);
}
}
// 直播登录
......@@ -130,7 +137,9 @@ RCT_EXPORT_METHOD(
// // 抽奖功能必须固定唯一的 nickName 和 userId,如果忘了填写上次的中奖信息,有固定的 userId 还会再次弹出相关填写页面
// liveVC.nickName = @"iOS user"; // 设置登录聊天室的用户名
// liveVC.avatarUrl = @"https://"; // 设置自定义聊天室用户头像地址
[viewController presentViewController:liveVC animated:YES completion:nil];
liveVC.modalPresentationStyle = UIModalPresentationFullScreen;
[viewController presentViewController:liveVC animated:YES completion:nil];
resolve(@[@(PolyvCloudClassError_Success)]);
......@@ -148,6 +157,7 @@ RCT_EXPORT_METHOD(
// // 抽奖功能必须固定唯一的 nickName 和 userId,如果忘了填写上次的中奖信息,有固定的 userId 还会再次弹出相关填写页面
// liveVC.nickName = @"iOS user"; // 设置登录聊天室的用户名
// liveVC.avatarUrl = @"https://"; // 设置自定义聊天室用户头像地址
liveVC.modalPresentationStyle = UIModalPresentationFullScreen;
[viewController presentViewController:liveVC animated:YES completion:nil];
NSLog(@"频道菜单获取失败!%@",error);
......
......@@ -85,7 +85,8 @@ typedef NS_ENUM(NSInteger, PLVChatroomErrorCode) {
@property (nonatomic, assign) BOOL allowToSpeakInTeacherMode;
/**
是否有观看直播权限
是否有观看直播权限(0.9.0废弃,由服务器处理)
参看SocketIO -socketIO: didLoginFailed: 回调方法
@param roomId 房间号
@return YES/NO
......
......@@ -9,7 +9,7 @@
#import "PLVChatroomController.h"
#import <Masonry/Masonry.h>
#import <SDWebImage/SDWebImageDownloader.h>
#import <PolyvFoundationSDK/PLVDateUtil.h>
#import <PolyvFoundationSDK/PLVFdUtil.h>
#import <PolyvCloudClassSDK/PLVLiveVideoConfig.h>
#import <PolyvCloudClassSDK/PLVLiveVideoAPI.h>
#import "PLVChatroomModel.h"
......@@ -126,7 +126,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
- (void)setSwitchInfo:(NSDictionary *)switchInfo {
_switchInfo = switchInfo;
if (self.type != PLVTextInputViewTypePrivate) {
//_closed = ![switchInfo[@"chat"] boolValue];
_closed = ![switchInfo[@"chat"] boolValue];
self.enableWelcome = [switchInfo[@"welcome"] boolValue]; // 欢迎语开关
if ([switchInfo[@"viewerSendImgEnabled"] boolValue]) { // 图片开关
[self.chatInputView loadViews:self.type enableMore:YES];
......@@ -295,7 +295,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
switch (object.eventType) {
case PLVSocketChatRoomEventType_LOGIN: {
NSString *userId = object.jsonDict[PLVSocketIOChatRoom_LOGIN_userKey][PLVSocketIOChatRoomUserUserIdKey];
BOOL me = [userId isEqualToString:socketUser.userId];
BOOL me = [Fd_StringValueWithJsonValue(userId) isEqualToString:socketUser.userId];
[self.chatroomQueue addSocketChatRoomObject:object me:me];
if (me && self.delegate && [self.delegate respondsToSelector:@selector(chatroom:userInfo:)]) {
[self.delegate chatroom:self userInfo:object.jsonDict];
......@@ -312,9 +312,9 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
[self presentViewController:alertController animated:YES completion:nil];
} break;
case PLVSocketChatRoomEventType_SET_NICK: {
NSString *status = object.jsonDict[@"status"];
NSString *status = Fd_StringValueWithJsonValue(object.jsonDict[@"status"]);
if ([status isEqualToString:@"success"]) {// success:广播消息
if ([object.jsonDict[@"userId"] isEqualToString:socketUser.userId]) {
if ([Fd_StringValueWithJsonValue(object.jsonDict[@"userId"]) isEqualToString:socketUser.userId]) {
[[PLVChatroomManager sharedManager] renameUserNick:object.jsonDict[@"nick"]];
[self showMessage:object.jsonDict[@"message"]];
}
......@@ -331,17 +331,18 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
[self clearAllData];
} break;
case PLVSocketChatRoomEventType_ADD_SHIELD: {
if ([object.jsonDict[@"value"] isEqualToString:socketUser.clientIp]) {
if ([Fd_StringValueWithJsonValue(object.jsonDict[@"value"]) isEqualToString:socketUser.clientIp]) {
socketUser.banned = YES;
}
} break;
case PLVSocketChatRoomEventType_REMOVE_SHIELD: {
if ([object.jsonDict[@"value"] isEqualToString:socketUser.clientIp]) {
if ([Fd_StringValueWithJsonValue(object.jsonDict[@"value"]) isEqualToString:socketUser.clientIp]) {
socketUser.banned = NO;
}
} break;
case PLVSocketChatRoomEventType_KICK: {
if ([object.jsonDict[@"user"][@"userId"] isEqualToString:socketUser.userId]) {
NSString *userId = Fd_StringValueWithJsonValue(object.jsonDict[@"user"][@"userId"]);
if ([userId isEqualToString:socketUser.userId]) {
[forbiddenUsers addObject:@(self.roomId)];
if (self.delegate && [self.delegate respondsToSelector:@selector(chatroom:didOpenError:)]) {
[self.delegate chatroom:self didOpenError:PLVChatroomErrorCodeBeKicked];
......@@ -383,7 +384,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
}
} break;
case PLVSocketChatRoomEventType_LIKES: {
if (![object.jsonDict[@"userId"] isEqualToString:socketUser.userId]) {
if (![Fd_StringValueWithJsonValue(object.jsonDict[@"userId"]) isEqualToString:socketUser.userId]) {
[self handleLikeSocket:object];
}
} break;
......@@ -393,7 +394,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
} break;
}
if (object.eventType==PLVSocketChatRoomEventType_LOGIN || object.eventType==PLVSocketChatRoomEventType_LOGOUT) {
self.onlineCount = [object.jsonDict[@"onlineUserNumber"] unsignedIntegerValue];
self.onlineCount = Fd_IntegerValueWithJsonValue(object.jsonDict[@"onlineUserNumber"]);
if (self.delegate && [self.delegate respondsToSelector:@selector(refreshLinkMicOnlineCount:number:)]) {
[self.delegate refreshLinkMicOnlineCount:self number:self.onlineCount];
}
......@@ -839,6 +840,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
pickerVC.delegate = self;
ZNavigationController *navigationController = [[ZNavigationController alloc] initWithRootViewController:pickerVC];
[PCCUtils deviceOnInterfaceOrientationMaskPortrait];
if (@available(iOS 13.0, *)) { navigationController.modalPresentationStyle = UIModalPresentationFullScreen; }
[(UIViewController *)self.delegate presentViewController:navigationController animated:YES completion:nil];
}
......@@ -847,6 +849,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
PLVCameraViewController *cameraVC = [[PLVCameraViewController alloc] init];
cameraVC.delegate = self;
[PCCUtils deviceOnInterfaceOrientationMaskPortrait];
if (@available(iOS 13.0, *)) { cameraVC.modalPresentationStyle = UIModalPresentationFullScreen; }
[(UIViewController *)self.delegate presentViewController:cameraVC animated:YES completion:nil];
}
......@@ -959,7 +962,7 @@ PLVSocketChatRoomObject *createTeacherAnswerObject() {
#pragma mark Upload Image
- (void)uploadImage:(UIImage *)image {
NSString *imageId = [NSString stringWithFormat:@"chat_img_iOS_%@", [PLVDateUtil curTimeStamp]];
NSString *imageId = [NSString stringWithFormat:@"chat_img_iOS_%@", [PLVFdUtil curTimeStamp]];
NSString *imageName = [NSString stringWithFormat:@"%@.jpeg", imageId];
PLVSocketChatRoomObject *uploadObject = [PLVSocketChatRoomObject chatRoomObjectForSendImageWithValues:@[imageId, image]];
PLVChatroomModel *model = [PLVChatroomModel modelWithObject:uploadObject];
......
......@@ -7,6 +7,7 @@
//
#import "PLVChatroomManager.h"
#import <PolyvFoundationSDK/PLVFdUtil.h>
static PLVChatroomManager *manager = nil;
......@@ -37,8 +38,8 @@ static PLVChatroomManager *manager = nil;
+ (PLVChatroomModel *)modelWithHistoryMessageDict:(NSDictionary *)messageDict {
PLVChatroomModel *model;
NSString *msgType = messageDict[@"msgType"];
NSString *msgSource = messageDict[@"msgSource"];
NSString *msgType = Fd_StringValueWithJsonValue(messageDict[@"msgType"]);
NSString *msgSource = Fd_StringValueWithJsonValue(messageDict[@"msgSource"]);
if (msgType) {
if ([msgType isEqualToString:@"customMessage"]) { // 自定义消息
......@@ -54,7 +55,7 @@ static PLVChatroomManager *manager = nil;
model = [PLVChatroomModel modelWithObject:chatroomObject];
} // redpaper(红包)、get_redpaper(领红包)
} else {
NSString *uid = [NSString stringWithFormat:@"%@",messageDict[@"user"][@"uid"]];
NSString *uid = Fd_StringValueWithJsonValue(messageDict[@"user"][@"uid"]);
if ([uid isEqualToString:@"1"] || [uid isEqualToString:@"2"]) {
// uid = 1,打赏消息;uid = 2,自定义消息
}else { // 发言消息
......@@ -75,10 +76,10 @@ static PLVChatroomManager *manager = nil;
PLVChatroomCustomModel *customModel;
NSString *event = customMessage[@"EVENT"];
if ([customMessage[@"version"] integerValue] == 1) {
if (Fd_IntegerValueWithJsonValue(customMessage[@"version"]) == 1) {
if (!mine) {
// 如果提交的消息广播返回了自己需要过滤掉此消息
NSString *userId = customMessage[@"user"][@"userId"];
NSString *userId = Fd_StringValueWithJsonValue(customMessage[@"user"][@"userId"]);
if ([userId isEqualToString:manager.socketUser.userId]) {
return nil;
}
......
......@@ -119,8 +119,8 @@
self.danmuLayer.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.danmuLayer.hidden = YES;
self.danmuLayer.userInteractionEnabled = NO;
[self.view insertSubview:self.danmuLayer belowSubview:self.skinView];
}
[self.mainView addSubview:self.danmuLayer];
}
- (void)addDanmuInputView {
......
......@@ -25,6 +25,7 @@
@property (nonatomic, strong) PLVVideoMarquee *videoMarquee; // 视频跑马灯
@property (nonatomic, strong) UIButton *backBtn;
@property (nonatomic, assign) BOOL iPad;
@property (nonatomic, assign) BOOL hadSetEnableDanmuModule;
@end
......@@ -147,6 +148,7 @@
- (void)setEnableDanmuModule:(BOOL)enableDanmuModule{
_enableDanmuModule = enableDanmuModule;
[self refreshDanmuModuleState];
_hadSetEnableDanmuModule = YES;
}
- (void)setShowDanmuOnPortrait:(BOOL)showDanmuOnPortrait{
......@@ -238,7 +240,7 @@
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
if (UIDeviceOrientationIsFlat(orientation) || orientation == UIDeviceOrientationUnknown) {
if (self.hadSetEnableDanmuModule && (UIDeviceOrientationIsFlat(orientation) || orientation == UIDeviceOrientationUnknown)) {
return;
}
......
......@@ -9,7 +9,7 @@
#import "PLVPlayerSkinView.h"
#import <MediaPlayer/MPVolumeView.h>
#import <Masonry/Masonry.h>
#import <PolyvFoundationSDK/PLVDateUtil.h>
#import <PolyvFoundationSDK/PLVFdUtil.h>
#import "PLVBrightnessView.h"
#import "PCCUtils.h"
......@@ -260,10 +260,18 @@ typedef NS_ENUM(NSInteger, PLVPlayerSkinViewPanType) {
moreMargin = UIEdgeInsetsMake(10.0, -1.0, -1.0, lrPadding);
self.zoomScreenBtn.hidden = YES;
closeSecondaryMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding * 0);
danmuMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding * 1);
if (self.type == PLVPlayerSkinViewTypeNormalLive) {
danmuMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding);
} else {
danmuMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding * 1);
}
} else {
closeSecondaryMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding * 1);
danmuMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding * 2);
if (self.type == PLVPlayerSkinViewTypeNormalLive) {
danmuMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding);
} else {
danmuMargin = UIEdgeInsetsMake(-1.0, -1.0, 0.0, lrPadding + btnPadding * 2);
}
}
} else {
UIEdgeInsets sliderBackgroundMargin = UIEdgeInsetsMake(-1.0, 0.0, 44.0, 0.0);
......@@ -403,7 +411,7 @@ typedef NS_ENUM(NSInteger, PLVPlayerSkinViewPanType) {
CGFloat dx = p.x - self.lastPoint.x;
self.slider.value = [self valueOfDistance:dx baseValue:self.slider.value];
self.seekSlider.value = self.slider.value;
NSString *text = [PLVDateUtil secondsToString:self.slider.value * self.duration];
NSString *text = [PLVFdUtil secondsToString:self.slider.value * self.duration];
self.currentPlayTimeLabel.text = text;
self.seekTimeLable.text = text;
if (gestureRecognizer.state == UIGestureRecognizerStateEnded || gestureRecognizer.state == UIGestureRecognizerStateCancelled) {
......
......@@ -62,20 +62,28 @@
[self initData];
BOOL watchPermission = [PLVChatroomController havePermissionToWatchLive:self.channelId];
if (watchPermission) {
[self addMediaViewController];
[self loadChannelMenuInfos];
} else {
__weak typeof(self) weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[weakSelf exitCurrentControllerWithAlert:nil message:@"您未被授权观看本直播"];
});
}
[self addMediaViewController];
[self loadChannelMenuInfos];
// [self playerPolling];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (self.navigationController) {
self.navigationController.navigationBarHidden = YES;
}
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
if (self.navigationController) {
self.navigationController.navigationBarHidden = NO;
}
}
- (void)playerPolling {
if (@available(iOS 10.0, *)) {
self.pollingTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 repeats:YES block:^(NSTimer * _Nonnull timer) {
......@@ -131,6 +139,7 @@
self.mediaVC.originFrame = CGRectMake(0.0, 0.0, self.view.bounds.size.width, self.mediaViewControllerHeight);
self.mediaVC.view.frame = self.mediaVC.originFrame;
[self.view addSubview:self.mediaVC.view];
//self.mediaVC.showDanmuOnPortrait = YES; // 竖屏显示弹幕按钮
CGFloat secondaryWidth = (int)([UIScreen mainScreen].bounds.size.width / self.linkMicVC.colNum);
CGFloat secondaryHeight = (int)(secondaryWidth * PPTPlayerViewScale);
......@@ -204,7 +213,7 @@
}
if (titles.count>0 && controllers.count>0 && titles.count==controllers.count) {
self.pageController = [[FTPageController alloc] initWithTitles:titles controllers:controllers barHeight:barHeight touchHeight:26.0];
self.pageController = [[FTPageController alloc] initWithTitles:titles controllers:controllers barHeight:barHeight touchHeight:16.0];
self.pageController.delegate = self;
self.pageController.view.frame = pageCtrlFrame;
[self.view insertSubview:self.pageController.view belowSubview:self.mediaVC.view]; // 需要添加在播放器下面,使得播放器全屏的时候能盖住聊天室
......@@ -333,7 +342,11 @@
[self.pollingTimer invalidate];
self.pollingTimer = nil;
}
[self dismissViewControllerAnimated:YES completion:nil];
if (self.navigationController) {
[self.navigationController popViewControllerAnimated:YES];
} else {
[self dismissViewControllerAnimated:YES completion:nil];
}
}
- (void)exitCurrentControllerWithAlert:(NSString *)title message:(NSString *)message {
......@@ -365,6 +378,12 @@
}
#pragma mark - PLVSocketIODelegate
- (void)socketIO:(PLVSocketIO *)socketIO didLoginFailed:(NSDictionary *)jsonDict {
NSLog(@"%s %@",__FUNCTION__,jsonDict);
[socketIO disconnect];
[self exitCurrentControllerWithAlert:nil message:@"您未被授权观看本直播"];
}
// 此方法可能多次调用,如锁屏后返回会重连聊天室
- (void)socketIO:(PLVSocketIO *)socketIO didConnectWithInfo:(NSString *)info {
NSLog(@"%@--%@", NSStringFromSelector(_cmd), info);
......
......@@ -68,6 +68,22 @@
// [self playerPolling];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (self.navigationController) {
self.navigationController.navigationBarHidden = YES;
}
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
if (self.navigationController) {
self.navigationController.navigationBarHidden = NO;
}
}
- (void)playerPolling {
if (@available(iOS 10.0, *)) {
self.pollingTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 repeats:YES block:^(NSTimer * _Nonnull timer) {
......@@ -155,7 +171,11 @@
[self.pollingTimer invalidate];
self.pollingTimer = nil;
}
[self dismissViewControllerAnimated:YES completion:nil];
if (self.navigationController) {
[self.navigationController popViewControllerAnimated:YES];
} else {
[self dismissViewControllerAnimated:YES completion:nil];
}
}
- (void)statusBarAppearanceNeedsUpdate:(PLVBaseMediaViewController *)mediaVC {
......
......@@ -1493,6 +1493,11 @@
attributes = {
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
DevelopmentTeam = 8BMZBNN3Q5;
};
};
};
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "PolyvRNCloudClassDemo" */;
compatibilityVersion = "Xcode 3.2";
......@@ -2097,10 +2102,12 @@
baseConfigurationReference = C73086D9970902EF492AC86C /* Pods-PolyvRNCloudClassDemo.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 8BMZBNN3Q5;
INFOPLIST_FILE = PolyvRNCloudClassDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.0.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
......@@ -2108,7 +2115,6 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = PolyvRNCloudClassDemo;
SWIFT_VERSION = 4.0;
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
......@@ -2118,9 +2124,11 @@
baseConfigurationReference = 0AE56CE7DE9AD8FF238BD4D0 /* Pods-PolyvRNCloudClassDemo.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 8BMZBNN3Q5;
INFOPLIST_FILE = PolyvRNCloudClassDemo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";