Skip to content

Commit

Permalink
update live to adapter ios10
Browse files Browse the repository at this point in the history
  • Loading branch information
lizilong1989 committed Dec 13, 2016
1 parent 63547d6 commit dcaf0de
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 31 deletions.
8 changes: 6 additions & 2 deletions EaseMobLiveDemo/EaseMobLiveDemo.xcodeproj/project.pbxproj
Expand Up @@ -1332,6 +1332,7 @@
E94670CE1BD78B9B00374D7A = {
CreatedOnToolsVersion = 6.4;
DevelopmentTeam = 499WYUV8Q2;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.BackgroundModes = {
enabled = 1;
Expand Down Expand Up @@ -1477,7 +1478,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
835E40F17F3084ECE0D18697 /* [CP] Embed Pods Frameworks */ = {
Expand Down Expand Up @@ -1703,6 +1704,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 499WYUV8Q2;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
Expand Down Expand Up @@ -1736,7 +1738,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-1";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = 499WYUV8Q2;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
Expand All @@ -1758,6 +1761,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.easemob.enterprise.demo.live;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
TARGETED_DEVICE_FAMILY = 1;
};
name = Release;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion EaseMobLiveDemo/EaseMobLiveDemo/AppDelegate+Hyphenate.m
Expand Up @@ -14,7 +14,7 @@ - (void)initHyphenateSDK
{
[[EMClient sharedClient] addDelegate:self delegateQueue:nil];

EMOptions *options = [EMOptions optionsWithAppkey:@"easemob-demo#chatdemo"];
EMOptions *options = [EMOptions optionsWithAppkey:@"easemob-demo#livedemo"];

NSString *apnsCertName = nil;
#if DEBUG
Expand Down
6 changes: 6 additions & 0 deletions EaseMobLiveDemo/EaseMobLiveDemo/Info.plist
Expand Up @@ -29,6 +29,12 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string></string>
<key>NSMicrophoneUsageDescription</key>
<string></string>
<key>NSPhotoLibraryUsageDescription</key>
<string></string>
<key>UIAppFonts</key>
<array>
<string>iconfont.ttf</string>
Expand Down
Expand Up @@ -71,12 +71,12 @@ - (void)loadData

//为了演示
weakSelf.dataArray = [NSMutableArray arrayWithArray:@[
[[EasePublishModel alloc] initWithName:@"Test1" number:@"100人" headImageName:@"1" streamId:@"em_10001" chatroomId:@"203138578711052716"],
[[EasePublishModel alloc] initWithName:@"Test2" number:@"100人" headImageName:@"2" streamId:@"em_10002" chatroomId:@"203138620012364216"],
[[EasePublishModel alloc] initWithName:@"Test3" number:@"100人" headImageName:@"3" streamId:@"em_10003" chatroomId:@"203138637011878328"],
[[EasePublishModel alloc] initWithName:@"Test4" number:@"100人" headImageName:@"4" streamId:@"em_10004" chatroomId:@"203138652547580344"],
[[EasePublishModel alloc] initWithName:@"Test5" number:@"100人" headImageName:@"5" streamId:@"em_10005" chatroomId:@"203138578711052716"],
[[EasePublishModel alloc] initWithName:@"Test6" number:@"100人" headImageName:@"6" streamId:@"em_10006" chatroomId:@"203138578711052716"]]];
[[EasePublishModel alloc] initWithName:@"Test1" number:@"100人" headImageName:@"1" streamId:@"em_100001" chatroomId:@"218746635482562996"],
[[EasePublishModel alloc] initWithName:@"Test2" number:@"100人" headImageName:@"2" streamId:@"em_100002" chatroomId:@"218747106892972464"],
[[EasePublishModel alloc] initWithName:@"Test3" number:@"100人" headImageName:@"3" streamId:@"em_100003" chatroomId:@"218747152489251244"],
[[EasePublishModel alloc] initWithName:@"Test4" number:@"100人" headImageName:@"4" streamId:@"em_100004" chatroomId:@"218747179836113332"],
[[EasePublishModel alloc] initWithName:@"Test5" number:@"100人" headImageName:@"5" streamId:@"em_100005" chatroomId:@"218747226120257964"],
[[EasePublishModel alloc] initWithName:@"Test6" number:@"100人" headImageName:@"6" streamId:@"em_100006" chatroomId:@"218747262707171768"]]];
[weakSelf.collectionView reloadData];
[weakSelf.collectionHotView reloadData];
[weakSelf.collectionStarView reloadData];
Expand Down
Expand Up @@ -36,12 +36,12 @@ - (void)viewDidLoad

//测试数据
self.dataSource = [NSMutableArray arrayWithArray:@[
[[EasePublishModel alloc] initWithName:@"Test1" number:@"100人" headImageName:@"1" streamId:@"em_10001" chatroomId:@"203138578711052716"],
[[EasePublishModel alloc] initWithName:@"Test2" number:@"100人" headImageName:@"2" streamId:@"em_10002" chatroomId:@"203138620012364216"],
[[EasePublishModel alloc] initWithName:@"Test3" number:@"100人" headImageName:@"3" streamId:@"em_10003" chatroomId:@"203138637011878328"],
[[EasePublishModel alloc] initWithName:@"Test4" number:@"100人" headImageName:@"4" streamId:@"em_10004" chatroomId:@"203138652547580344"],
[[EasePublishModel alloc] initWithName:@"Test5" number:@"100人" headImageName:@"5" streamId:@"em_10005" chatroomId:@"203138578711052716"],
[[EasePublishModel alloc] initWithName:@"Test6" number:@"100人" headImageName:@"6" streamId:@"em_10006" chatroomId:@"203138578711052716"]]];
[[EasePublishModel alloc] initWithName:@"Test1" number:@"100人" headImageName:@"1" streamId:@"em_100001" chatroomId:@"218746635482562996"],
[[EasePublishModel alloc] initWithName:@"Test2" number:@"100人" headImageName:@"2" streamId:@"em_100002" chatroomId:@"218747106892972464"],
[[EasePublishModel alloc] initWithName:@"Test3" number:@"100人" headImageName:@"3" streamId:@"em_100003" chatroomId:@"218747152489251244"],
[[EasePublishModel alloc] initWithName:@"Test4" number:@"100人" headImageName:@"4" streamId:@"em_100004" chatroomId:@"218747179836113332"],
[[EasePublishModel alloc] initWithName:@"Test5" number:@"100人" headImageName:@"5" streamId:@"em_100005" chatroomId:@"218747226120257964"],
[[EasePublishModel alloc] initWithName:@"Test6" number:@"100人" headImageName:@"6" streamId:@"em_100006" chatroomId:@"218747262707171768"]]];

[self setupSearchBar];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.backButton];
Expand Down
Expand Up @@ -33,7 +33,7 @@
#define kDefaultTop 31.f
#define kDefaultLeft 18.f

@interface EasePublishViewController () <EaseChatViewDelegate,UITextViewDelegate,EMChatroomManagerDelegate,EaseEndLiveViewDelegate,TapBackgroundViewDelegate,EaseLiveHeaderListViewDelegate,EaseProfileLiveViewDelegate>
@interface EasePublishViewController () <EaseChatViewDelegate,UITextViewDelegate,EMChatroomManagerDelegate,EaseEndLiveViewDelegate,TapBackgroundViewDelegate,EaseLiveHeaderListViewDelegate,EaseProfileLiveViewDelegate,UIAlertViewDelegate>
{
BOOL _isload;
BOOL _isShutDown;
Expand All @@ -44,6 +44,8 @@ @interface EasePublishViewController () <EaseChatViewDelegate,UITextViewDelegate
BOOL _isPublish;

EasePublishModel *_model;

NSString *_chatroomID;
}

@property (nonatomic, strong) UIButton *closeBtn;
Expand Down Expand Up @@ -82,6 +84,25 @@ - (void)viewDidLoad {
self.title = @"发布直播";
self.view.backgroundColor = [UIColor colorWithRed:0.88 green:0.88 blue:0.88 alpha:1.0];

self.streamId = @"em_100001";
_chatroomID = @"218746635482562996";
if ([[EMClient sharedClient].currentUsername isEqualToString:@"test2"]) {
self.streamId = @"em_100002";
_chatroomID = @"218747106892972464";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test3"]) {
self.streamId = @"em_100003";
_chatroomID = @"218747152489251244";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test4"]) {
self.streamId = @"em_100004";
_chatroomID = @"218747179836113332";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test5"]) {
self.streamId = @"em_100005";
_chatroomID = @"218747226120257964";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test6"]) {
self.streamId = @"em_100006";
_chatroomID = @"218747262707171768";
}

[self setupForDismissKeyboard];

[self.view addSubview:self.castView];
Expand All @@ -98,21 +119,19 @@ - (void)viewDidLoad {

[[EMClient sharedClient].roomManager addDelegate:self delegateQueue:nil];

self.streamId = @"em_10001";
if ([[EMClient sharedClient].currentUsername isEqualToString:@"test2"]) {
self.streamId = @"em_10002";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test3"]) {
self.streamId = @"em_10003";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test4"]) {
self.streamId = @"em_10004";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test5"]) {
self.streamId = @"em_10005";
} else if ([[EMClient sharedClient].currentUsername isEqualToString:@"test6"]) {
self.streamId = @"em_10006";
if ([[EMClient sharedClient].currentUsername isEqualToString:@"test1"] ||
[[EMClient sharedClient].currentUsername isEqualToString:@"test2"] ||
[[EMClient sharedClient].currentUsername isEqualToString:@"test3"] ||
[[EMClient sharedClient].currentUsername isEqualToString:@"test4"] ||
[[EMClient sharedClient].currentUsername isEqualToString:@"test5"] ||
[[EMClient sharedClient].currentUsername isEqualToString:@"test6"]) {
[self startAction];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"Demo必须使用test1,test2,test3,test4,test5,test6账号发起直播" delegate:self cancelButtonTitle:@"确认" otherButtonTitles:nil, nil];
alert.tag = 1000;
[alert show];
}

[self startAction];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
}

- (void)dealloc
Expand Down Expand Up @@ -168,7 +187,7 @@ - (EaseLiveHeaderListView*)headerListView
- (EaseChatView*)chatview
{
if (_chatview == nil) {
_chatview = [[EaseChatView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.bounds) - 200, CGRectGetWidth(self.view.bounds), 200) chatroomId:kDefaultChatroomId isPublish:YES];
_chatview = [[EaseChatView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.view.bounds) - 200, CGRectGetWidth(self.view.bounds), 200) chatroomId:_chatroomID isPublish:YES];
_chatview.delegate = self;
}
return _chatview;
Expand Down Expand Up @@ -489,6 +508,15 @@ - (void)startAction
}
}

#pragma mark - UIAlertViewDelegate

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 1000) {
[self closeAction];
}
}

#pragma mark - EaseLiveHeaderListViewDelegate

- (void)didSelectHeaderWithUsername:(NSString *)username
Expand Down
Binary file modified EaseMobLiveDemo/EaseMobLiveDemo/lib/Player/libUCloudMediaPlayer.a
Binary file not shown.
Binary file modified EaseMobLiveDemo/EaseMobLiveDemo/lib/Recorder/libUCloudMediaRecorder.a
Binary file not shown.

0 comments on commit dcaf0de

Please sign in to comment.