Commit 99b3610b84b9007291b93f763a763915f4d63c9e

Authored by 朱林
1 parent e320e1e5

no message

CNLiveShortVideoSDKDemo/CNLiveShortVideoDemo.xcodeproj/project.pbxproj
@@ -687,7 +687,7 @@ @@ -687,7 +687,7 @@
687 "$(PROJECT_DIR)/CNLiveShortVideoDemo/Resources/ShortVideoResources/FaceUResource", 687 "$(PROJECT_DIR)/CNLiveShortVideoDemo/Resources/ShortVideoResources/FaceUResource",
688 ); 688 );
689 OTHER_LDFLAGS = "-ObjC"; 689 OTHER_LDFLAGS = "-ObjC";
690 - PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.video; 690 + PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shortvideo;
691 PRODUCT_NAME = "$(TARGET_NAME)"; 691 PRODUCT_NAME = "$(TARGET_NAME)";
692 }; 692 };
693 name = Debug; 693 name = Debug;
@@ -714,7 +714,7 @@ @@ -714,7 +714,7 @@
714 "$(PROJECT_DIR)/CNLiveShortVideoDemo/Resources/ShortVideoResources/FaceUResource", 714 "$(PROJECT_DIR)/CNLiveShortVideoDemo/Resources/ShortVideoResources/FaceUResource",
715 ); 715 );
716 OTHER_LDFLAGS = "-ObjC"; 716 OTHER_LDFLAGS = "-ObjC";
717 - PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.video; 717 + PRODUCT_BUNDLE_IDENTIFIER = com.cnlive.shortvideo;
718 PRODUCT_NAME = "$(TARGET_NAME)"; 718 PRODUCT_NAME = "$(TARGET_NAME)";
719 }; 719 };
720 name = Release; 720 name = Release;
CNLiveShortVideoSDKDemo/CNLiveShortVideoDemo/CNLiveShortVideoPrefix.pch
@@ -28,10 +28,10 @@ @@ -28,10 +28,10 @@
28 #define kAERootViewShowFrame CGRectMake(0, kScreenSizeHeight - 212, kScreenSizeWidth, 212) 28 #define kAERootViewShowFrame CGRectMake(0, kScreenSizeHeight - 212, kScreenSizeWidth, 212)
29 29
30 30
31 -#define AppId @"60_irn9edco29"  
32 -#define AppKey @"69fe70bda67e059286ad509d9f5377f815955645b52f94"  
33 -#define bundleID @"com.cnlive.video"  
34 -//com.cnlive.shortvideo.demo 31 +#define AppId @"60_j4rzqads62"
  32 +#define AppKey @"ae0c2fea70d08e49b6a5ebb99ad7d6e8eec07de722701b"
  33 +#define AppSecret @"2bccf04da8de5576d212f7682814af9de3c77adf5cecc7"
  34 +#define bundleID @"com.cnlive.shortvideo"
35 35
36 #ifdef __OBJC__ 36 #ifdef __OBJC__
37 37
CNLiveShortVideoSDKDemo/CNLiveShortVideoDemo/Controllers/CfgViewController.m
@@ -11,6 +11,9 @@ @@ -11,6 +11,9 @@
11 #import "PreviewViewController.h" 11 #import "PreviewViewController.h"
12 12
13 @interface CfgViewController () 13 @interface CfgViewController ()
  14 +{
  15 + NSString *_maxDuration;
  16 +}
14 17
15 @property (nonatomic, strong) UILabel *frameLabel; 18 @property (nonatomic, strong) UILabel *frameLabel;
16 @property (nonatomic, strong) UILabel *resLabel; 19 @property (nonatomic, strong) UILabel *resLabel;
@@ -55,12 +58,21 @@ @@ -55,12 +58,21 @@
55 [self.view addSubview:self.saveBtn]; 58 [self.view addSubview:self.saveBtn];
56 [self.view addSubview:self.backBtn]; 59 [self.view addSubview:self.backBtn];
57 60
  61 + //鉴权
  62 + [[CNLiveMediaEditor shareInstance] registerCNMediaEditorKit:^(NSString *maxDuration) {
  63 +
  64 + _maxDuration = maxDuration;
  65 +
  66 + } failure:^(NSDictionary *errorDic) {
  67 + NSLog(@"鉴权失败:%@", errorDic[@"errorMessage"]);
  68 + }];
58 } 69 }
59 70
60 #pragma mark - 71 #pragma mark -
61 #pragma mark - action 72 #pragma mark - action
62 - (void)startRecord { 73 - (void)startRecord {
63 PreviewViewController *preVC = [[PreviewViewController alloc] init]; 74 PreviewViewController *preVC = [[PreviewViewController alloc] init];
  75 + preVC.maxDuration = _maxDuration;
64 [self presentViewController:preVC animated:YES completion:NULL]; 76 [self presentViewController:preVC animated:YES completion:NULL];
65 } 77 }
66 78
CNLiveShortVideoSDKDemo/CNLiveShortVideoDemo/Controllers/PreviewViewController.h
@@ -10,4 +10,6 @@ @@ -10,4 +10,6 @@
10 10
11 @interface PreviewViewController : UIViewController 11 @interface PreviewViewController : UIViewController
12 12
  13 +@property (nonatomic, strong) NSString *maxDuration;
  14 +
13 @end 15 @end
CNLiveShortVideoSDKDemo/CNLiveShortVideoDemo/Controllers/PreviewViewController.m
@@ -33,7 +33,6 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate, @@ -33,7 +33,6 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate,
33 @property (nonatomic, strong) AERootView *aeRootView; 33 @property (nonatomic, strong) AERootView *aeRootView;
34 34
35 @property (nonatomic, strong) GPUImageOutput<GPUImageInput>* curFilter; 35 @property (nonatomic, strong) GPUImageOutput<GPUImageInput>* curFilter;
36 -@property (nonatomic, strong) NSString *maxDuration; //最大时长  
37 36
38 @end 37 @end
39 38
@@ -51,15 +50,6 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate, @@ -51,15 +50,6 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate,
51 50
52 _previewView.videoMgrBtn.videoMgrState = kLoadfileState; 51 _previewView.videoMgrBtn.videoMgrState = kLoadfileState;
53 [CNLiveMediaEditor shareInstance].delegate = self; 52 [CNLiveMediaEditor shareInstance].delegate = self;
54 -  
55 - //鉴权  
56 - [[CNLiveMediaEditor shareInstance] registerCNMediaEditorKit:^(NSString *maxDuration) {  
57 -  
58 - _maxDuration = maxDuration;  
59 -  
60 - } failure:^(NSDictionary *errorDic) {  
61 - NSLog(@"鉴权失败:%@", errorDic[@"errorMessage"]);  
62 - }];  
63 53
64 } 54 }
65 55
@@ -441,7 +431,7 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate, @@ -441,7 +431,7 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate,
441 dispatch_async(dispatch_get_main_queue(), ^{ 431 dispatch_async(dispatch_get_main_queue(), ^{
442 [MBProgressHUD hideHUDForView:weakSelf.view animated:YES]; 432 [MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
443 433
444 - VideoEditorViewController *vc = [[VideoEditorViewController alloc] initWithUrl:weakSelf.filePath.path maxDuration:weakSelf.maxDuration]; 434 + VideoEditorViewController *vc = [[VideoEditorViewController alloc] initWithUrl:weakSelf.filePath maxDuration:weakSelf.maxDuration];
445 [self presentViewController:vc animated:YES completion:nil]; 435 [self presentViewController:vc animated:YES completion:nil];
446 }); 436 });
447 }]; 437 }];
@@ -546,7 +536,7 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate, @@ -546,7 +536,7 @@ UIImagePickerControllerDelegate,BeautyConfigViewDelegate,FaceUFiterViewDelegate,
546 } 536 }
547 537
548 //媒体文件处理完成 538 //媒体文件处理完成
549 -- (void)onComposeFinish:(NSString *)path thumbnail:(UIImage *)thumbnail 539 +- (void)onComposeFinish:(NSURL *)path thumbnail:(UIImage *)thumbnail
550 { 540 {
551 WeakSelf(PreviewViewController); 541 WeakSelf(PreviewViewController);
552 dispatch_async(dispatch_get_main_queue(), ^{ 542 dispatch_async(dispatch_get_main_queue(), ^{