Skip to content

Commit

Permalink
3.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vhall committed Jan 15, 2020
1 parent 0cb9216 commit 5a04a89
Show file tree
Hide file tree
Showing 27 changed files with 204 additions and 136 deletions.
14 changes: 12 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# vhallsdk-live-ios
自助式网络直播SDK

### 集成和调用方式
# 微吼直播 SaaS SDK v4.0 库迁移

**微吼直播 SaaS SDK v4.0 及以后版本迁移至
[vhallsdk_live_ios_v4.0](https://github.com/vhall/vhallsdk_live_ios_v4.0) 给您带来不便请谅解** <br>

## 集成和调用方式

[官方文档](http://www.vhall.com/saas/doc/310.html)<br>

参见官方文档:http://www.vhall.com/saas/doc/310.html <br>

### APP工程集成SDK基本设置
1、工程中AppDelegate.m 文件名修改为 AppDelegate.mm<br>
Expand Down Expand Up @@ -31,6 +37,10 @@ pod 'VHallSDK_LiveFilter' , :git => 'https://github.com/vhall/vhallsdk_live_ios.
pod 'VHallSDK_Interactive' , :git => 'https://github.com/vhall/vhallsdk_live_ios.git'<br>

### 版本更新信息
#### 版本 v3.4.5 更新时间:2020.01.15
更新内容:<br>
1、修复美颜进入卡顿问题<br>

#### 版本 v3.4.4 更新时间:2019.08.07
更新内容:<br>
1、修复推流bug<br>
Expand Down
21 changes: 21 additions & 0 deletions VHSDKDemo/VHSDKDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,7 @@
C000AA3B1E66E053005DFB7C /* Frameworks */,
C000AA3C1E66E053005DFB7C /* Resources */,
C0FABCE620EF1031003947C6 /* Embed Frameworks */,
C0EF3E2C23C8691800CC4791 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -685,6 +686,26 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
C0EF3E2C23C8691800CC4791 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\nAPP_PATH=\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\"\n\n# This script loops through the frameworks embedded in the application and\n# removes unused architectures.\nfind \"$APP_PATH\" -name '*.framework' -type d | while read -r FRAMEWORK\ndo\nFRAMEWORK_EXECUTABLE_NAME=$(defaults read \"$FRAMEWORK/Info.plist\" CFBundleExecutable)\nFRAMEWORK_EXECUTABLE_PATH=\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\"\necho \"Executable is $FRAMEWORK_EXECUTABLE_PATH\"\n\nEXTRACTED_ARCHS=()\n\nfor ARCH in $ARCHS\ndo\necho \"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\"\nlipo -extract \"$ARCH\" \"$FRAMEWORK_EXECUTABLE_PATH\" -o \"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\"\nEXTRACTED_ARCHS+=(\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\")\ndone\n\necho \"Merging extracted architectures: ${ARCHS}\"\nlipo -o \"$FRAMEWORK_EXECUTABLE_PATH-merged\" -create \"${EXTRACTED_ARCHS[@]}\"\nrm \"${EXTRACTED_ARCHS[@]}\"\n\necho \"Replacing original executable with thinned version\"\nrm \"$FRAMEWORK_EXECUTABLE_PATH\"\nmv \"$FRAMEWORK_EXECUTABLE_PATH-merged\" \"$FRAMEWORK_EXECUTABLE_PATH\"\n\ndone\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
C000AA3A1E66E053005DFB7C /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
Expand All @@ -38,8 +36,8 @@
ReferencedContainer = "container:VHSDKDemo.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -61,8 +59,6 @@
ReferencedContainer = "container:VHSDKDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
10 changes: 3 additions & 7 deletions VHSDKDemo/VHSDKDemo/Home/LoginViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ - (IBAction)loginBtnClick:(id)sender
VHLog(@"Account: %@ userID:%@",[VHallApi currentAccount],[VHallApi currentUserID]);
[weekself showMsg:@"登录成功" afterDelay:1.5];
VHHomeViewController *homeVC=[[VHHomeViewController alloc] init];
homeVC.modalPresentationStyle = UIModalPresentationFullScreen;
[weekself presentViewController:homeVC animated:YES completion:nil];

} failure:^(NSError * error) {
Expand All @@ -83,6 +84,7 @@ - (IBAction)guestCLick:(id)sender
return;
}
VHHomeViewController *homeVC=[[VHHomeViewController alloc] init];
homeVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:homeVC animated:YES completion:nil];
}

Expand All @@ -107,14 +109,8 @@ - (void)viewDidLoad {
// Do any additional setup after loading the view from its nib.
[self initViews];


#ifdef DEBUG
//测试工具
// [[WHDebugToolManager sharedInstance] toggleWith:DebugToolTypeMemory | DebugToolTypeCPU | DebugToolTypeFPS];
#else

#endif

[[WHDebugToolManager sharedInstance] toggleWith:DebugToolTypeMemory | DebugToolTypeCPU | DebugToolTypeFPS];
}

- (void)didReceiveMemoryWarning {
Expand Down
6 changes: 6 additions & 0 deletions VHSDKDemo/VHSDKDemo/Home/VHHomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ - (void)startLive:(UIInterfaceOrientation)orientation
rtmpLivedemoVC.videoCaptureFPS = DEMO_Setting.videoCaptureFPS;
rtmpLivedemoVC.interfaceOrientation = orientation;
rtmpLivedemoVC.isOpenNoiseSuppresion = DEMO_Setting.isOpenNoiseSuppresion;
rtmpLivedemoVC.beautifyFilterEnable = DEMO_Setting.beautifyFilterEnable;
rtmpLivedemoVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:rtmpLivedemoVC animated:YES completion:nil];
}

Expand Down Expand Up @@ -121,6 +123,7 @@ - (IBAction)btnClick:(UIButton*)sender
watchVC.roomId = DEMO_Setting.watchActivityID;
watchVC.kValue = DEMO_Setting.kValue;
watchVC.bufferTimes = DEMO_Setting.bufferTimes;
watchVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:watchVC animated:YES completion:nil];
}
break;
Expand All @@ -134,6 +137,7 @@ - (IBAction)btnClick:(UIButton*)sender
watchVC.roomId = DEMO_Setting.watchActivityID;
watchVC.kValue = DEMO_Setting.kValue;
watchVC.timeOut = DEMO_Setting.timeOut*1000;
watchVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:watchVC animated:YES completion:nil];
}
break;
Expand All @@ -145,6 +149,7 @@ - (IBAction)btnClick:(UIButton*)sender
- (IBAction)systemSettingClick:(id)sender
{
VHSettingViewController *settingVc=[[VHSettingViewController alloc] init];
settingVc.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:settingVc animated:YES completion:nil];
}
- (IBAction)loginOrloginOutClick:(id)sender
Expand All @@ -162,6 +167,7 @@ - (IBAction)loginOrloginOutClick:(id)sender
}else
{
LoginViewController *login = [[LoginViewController alloc] init];
login.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:login animated:YES completion:nil];
}
}
Expand Down
43 changes: 36 additions & 7 deletions VHSDKDemo/VHSDKDemo/Setting/VHSettingViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ @interface VHSettingViewController()<UITableViewDataSource,UITableViewDelegate,C
VHSettingTextFieldItem *item30;

UISwitch *_noiseSwitch;
UISwitch *_beautifySwitch;
}
@property(nonatomic,strong) NSMutableArray *groups;

Expand Down Expand Up @@ -59,11 +60,11 @@ -(void)initWithView
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hideKeyboard:)
name:UIKeyboardDidHideNotification object:nil];
[[UIApplication sharedApplication].keyWindow setBackgroundColor:[UIColor whiteColor]];
UIView *headerView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 64)];
UIView *headerView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, (iPhoneX?80:64))];
headerView.backgroundColor=[UIColor blackColor];
[self.view insertSubview:headerView atIndex:0];

UIButton *back = [[UIButton alloc] initWithFrame:CGRectMake(0,20, 44, 44)];
UIButton *back = [[UIButton alloc] initWithFrame:CGRectMake(0,iPhoneX?36:20, 44, 44)];
[back setImage:[UIImage imageNamed:@"nav_back"] forState:UIControlStateNormal];
[back addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
[headerView addSubview:back];
Expand All @@ -74,7 +75,7 @@ -(void)initWithView
[title setText:@"参数设置"];
[title setFont:[UIFont systemFontOfSize:18]];
[title sizeToFit];
title.center = CGPointMake(headerView.center.x, 40);
title.center = CGPointMake(headerView.center.x, iPhoneX?56:40);
[headerView addSubview:title];

_pickerView = [CustomPickerView loadFromXib];
Expand All @@ -84,8 +85,10 @@ -(void)initWithView

_noiseSwitch = [[UISwitch alloc]init];
[_noiseSwitch addTarget:self action:@selector(noiseSwitch) forControlEvents:UIControlEventValueChanged];
_beautifySwitch = [[UISwitch alloc]init];
[_beautifySwitch addTarget:self action:@selector(beautifySwitch) forControlEvents:UIControlEventValueChanged];

_tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, 64, self.view.width, [UIScreen mainScreen].bounds.size.height-64) style:UITableViewStyleGrouped];
_tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, (iPhoneX?80:64), self.view.width, [UIScreen mainScreen].bounds.size.height-(iPhoneX?80:64)) style:UITableViewStyleGrouped];
// tableView.backgroundColor=[UIColor whiteColor];
_tableView.userInteractionEnabled=YES;
UIView *header=[[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 30)];
Expand Down Expand Up @@ -140,12 +143,17 @@ - (void)didReceiveMemoryWarning {
// Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
_pickerView.frame = [UIScreen mainScreen].bounds;
}

- (void)viewDidLayoutSubviews
{
_tableView.frame = CGRectMake(0, (iPhoneX?80:64), self.view.width, [UIScreen mainScreen].bounds.size.height-(iPhoneX?80:64));
}

/*
#pragma mark - Navigation
Expand Down Expand Up @@ -252,15 +260,15 @@ -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)
{
VHSettingGroup *group =self.groups[section];
if(section == 1)
return group.items.count+1;
return group.items.count+2;
return group.items.count;
}


-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
VHSettingGroup *group=self.groups [indexPath.section];
if(indexPath.section == 1 && indexPath.row == group.items.count)
if(indexPath.section == 1 && indexPath.row == group.items.count)//@"音频降噪"
{
static NSString *Identifier = @"noiseSwitchCell";
UITableViewCell *noiseSwitchcell =[tableView dequeueReusableCellWithIdentifier:Identifier];
Expand All @@ -275,6 +283,21 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS

return noiseSwitchcell;
}
else if(indexPath.section == 1 && indexPath.row == group.items.count+1)
{
static NSString *Identifier = @"beautifySwitchcell";
UITableViewCell *beautifySwitchcell =[tableView dequeueReusableCellWithIdentifier:Identifier];
if (beautifySwitchcell == nil)
beautifySwitchcell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Identifier];
_beautifySwitch.on = DEMO_Setting.beautifyFilterEnable;
beautifySwitchcell.textLabel.text = @"美颜";
beautifySwitchcell.textLabel.font = [UIFont systemFontOfSize:14];
_beautifySwitch.left = self.view.width - 60;
_beautifySwitch.top = 10;
[beautifySwitchcell.contentView addSubview:_beautifySwitch];

return beautifySwitchcell;
}
else if(indexPath.section == 3 && indexPath.row == 0)
{
static NSString *identifier1 = @"selectedResolutionCell";
Expand Down Expand Up @@ -356,6 +379,7 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
if (arrowItem.desVc)
{
UIViewController *vc =[[arrowItem.desVc alloc] init];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:vc animated:YES completion:nil];
}
}
Expand Down Expand Up @@ -617,6 +641,11 @@ - (void)noiseSwitch
{
DEMO_Setting.isOpenNoiseSuppresion = _noiseSwitch.on;
}
- (void)beautifySwitch
{
DEMO_Setting.beautifyFilterEnable = _beautifySwitch.on;
}


-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
Expand Down
21 changes: 10 additions & 11 deletions VHSDKDemo/VHSDKDemo/Setting/VHStystemSetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,24 @@
@property(nonatomic, strong)NSString* activityID; //发直播活动ID 必填
@property(nonatomic, strong)NSString* watchActivityID; //观看活动ID

//观看设置
@property(nonatomic, assign)NSInteger bufferTimes; //RTMP观看缓冲时间
@property(nonatomic, strong)NSString* nickName; //用户昵称 为空默认随机字符串做昵称
@property(nonatomic, strong)NSString* email; //标示该游客用户唯一id 可填写用户邮箱 为空默认使用设备UUID做为唯一ID
@property(nonatomic, strong)NSString* kValue; //K值 可以为空
@property(nonatomic, assign)NSInteger timeOut; //超时时间 默认10s

//直播设置
@property(nonatomic, strong)NSString* videoResolution; //发起直播分辨率 VideoResolution [0,3] 默认1

//互动设置
@property(nonatomic, copy)NSString *pushResolution; //互动分辨率


@property(nonatomic, strong)NSString* liveToken; //直播令牌 只在发起直播时使用 暂时一天申请一次
@property(nonatomic, assign)NSInteger videoBitRate; //发直播视频码率
@property(nonatomic, assign)NSInteger audioBitRate; //发直播视频码率
@property(nonatomic, assign)NSInteger videoCaptureFPS; //发直播视频帧率 [1~30] 默认10
@property(nonatomic, assign)BOOL isOpenNoiseSuppresion;//开启降噪 默认YES
@property(nonatomic, assign)BOOL beautifyFilterEnable;//美颜开关

//观看设置
@property(nonatomic, assign)NSInteger bufferTimes; //RTMP观看缓冲时间
@property(nonatomic, strong)NSString* nickName; //用户昵称 为空默认随机字符串做昵称
@property(nonatomic, strong)NSString* email; //标示该游客用户唯一id 可填写用户邮箱 为空默认使用设备UUID做为唯一ID
@property(nonatomic, strong)NSString* kValue; //K值 可以为空
@property(nonatomic, assign)NSInteger timeOut; //超时时间 默认10s
//互动设置
@property(nonatomic, copy)NSString *pushResolution; //互动分辨率

//聊天问答等功能需登录
@property(nonatomic, strong)NSString* account; //账号
Expand Down
19 changes: 13 additions & 6 deletions VHSDKDemo/VHSDKDemo/Setting/VHStystemSetting.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ - (id)init
_videoResolution = @"2";
}

if(_videoBitRate<=0)
if(_videoBitRate<=500)
{
_videoBitRate = 600;
_videoBitRate = 800;
}
if(_audioBitRate<=0)
if(_audioBitRate<=64)
{
_audioBitRate = 16;
_audioBitRate = 64;
}
if(_videoCaptureFPS <1)
_videoCaptureFPS = 10;
if(_videoCaptureFPS <10)
_videoCaptureFPS = 15;
if(_videoCaptureFPS >30)
_videoCaptureFPS = 30;
if(_bufferTimes <=0)
Expand All @@ -134,6 +134,7 @@ - (id)init
self.isOpenNoiseSuppresion = [standardUserDefaults boolForKey:@"VHisOpenNoiseSuppresion"];
else
self.isOpenNoiseSuppresion = YES;
self.beautifyFilterEnable = [standardUserDefaults boolForKey:@"VHbeautifyFilterEnable"];

if(_appKey.length>0 && _appSecretKey.length>0)
{
Expand Down Expand Up @@ -250,6 +251,12 @@ - (void)setIsOpenNoiseSuppresion:(BOOL)isOpenNoiseSuppresion
[[NSUserDefaults standardUserDefaults] setBool:_isOpenNoiseSuppresion forKey:@"VHisOpenNoiseSuppresion"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (void)setBeautifyFilterEnable:(BOOL)beautifyFilterEnable
{
_beautifyFilterEnable = beautifyFilterEnable;
[[NSUserDefaults standardUserDefaults] setBool:_beautifyFilterEnable forKey:@"VHbeautifyFilterEnable"];
[[NSUserDefaults standardUserDefaults] synchronize];
}

- (void)setLiveToken:(NSString*)liveToken
{
Expand Down
7 changes: 7 additions & 0 deletions VHSDKDemo/VHSDKDemo/VHSDKDemo-Header.pch
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
#define VHScreenWidth ([UIScreen mainScreen].bounds.size.width)
#define VH_Device_OS_ver [[UIDevice currentDevice] systemVersion]

#define iPhoneX \
({BOOL isPhoneX = NO;\
if ([[[UIDevice currentDevice] systemVersion] floatValue]>=11.0) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})

#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
Expand Down
7 changes: 6 additions & 1 deletion VHSDKDemo/WHDebugTool/WHDebugToolManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
#import "WHDebugConsoleLabel.h"
#import "WHDebugTempVC.h"

#define kDebugIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDebugIsiPhoneX \
({BOOL isPhoneX = NO;\
if ([[[UIDevice currentDevice] systemVersion] floatValue]>=11.0) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})
#define kDebugScreenWidth [UIScreen mainScreen].bounds.size.width
#define kDebugLabelWidth 70
#define kDebugLabelHeight 20
Expand Down
Loading

0 comments on commit 5a04a89

Please sign in to comment.