Commit a52729477d02d0786a65046f2cd0dc3438479392

Authored by 朱林
1 parent 37a14aeb

no message

Showing 20 changed files with 54 additions and 40 deletions
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoController.m
@@ -118,6 +118,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat @@ -118,6 +118,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
118 118
119 // 默认开启 前置摄像头 119 // 默认开启 前置摄像头
120 _recorder.cameraPosition = AVCaptureDevicePositionFront; 120 _recorder.cameraPosition = AVCaptureDevicePositionFront;
  121 + _previewView.flashBtn.enabled = NO;
121 _recorder.minRecDuration = 3; 122 _recorder.minRecDuration = 3;
122 _recorder.maxRecDuration = [_maxDuration intValue]; 123 _recorder.maxRecDuration = [_maxDuration intValue];
123 124
@@ -174,6 +175,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat @@ -174,6 +175,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
174 175
175 case PreViewSubViewIdx_Flash: { 176 case PreViewSubViewIdx_Flash: {
176 177
  178 + weakSelf.previewView.flashBtn.selected = !weakSelf.previewView.flashBtn.selected;
177 if ([weakSelf.recorder isTorchSupported]){ 179 if ([weakSelf.recorder isTorchSupported]){
178 [weakSelf.recorder toggleTorch]; 180 [weakSelf.recorder toggleTorch];
179 } 181 }
@@ -184,15 +186,16 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat @@ -184,15 +186,16 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
184 case PreViewSubViewIdx_ToggleCamera: { 186 case PreViewSubViewIdx_ToggleCamera: {
185 187
186 __strong __typeof(weakSelf) strongSelf = weakSelf; 188 __strong __typeof(weakSelf) strongSelf = weakSelf;
  189 +
187 [strongSelf.recorder switchCamera]; 190 [strongSelf.recorder switchCamera];
  191 +
188 if (strongSelf.recorder.isTorchSupported) { 192 if (strongSelf.recorder.isTorchSupported) {
189 - // 显示闪光灯按钮  
190 - if (strongSelf.recorder.isTorchSupported) {  
191 - weakSelf.previewView.flashBtn.hidden = NO;  
192 - } }  
193 - else{  
194 - // 隐藏闪光灯按钮  
195 - weakSelf.previewView.flashBtn.hidden = YES; 193 +
  194 + weakSelf.previewView.flashBtn.enabled = YES;
  195 +
  196 + } else{
  197 +
  198 + weakSelf.previewView.flashBtn.enabled = NO;
196 } 199 }
197 200
198 } 201 }
@@ -209,6 +212,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat @@ -209,6 +212,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
209 break; 212 break;
210 213
211 case PreViewSubViewIdx_Effects: { 214 case PreViewSubViewIdx_Effects: {
  215 +
212 [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 216 [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
213 weakSelf.faceUView.frame = kAERootViewShowFrame; 217 weakSelf.faceUView.frame = kAERootViewShowFrame;
214 weakSelf.faceUView.beautyConfigViewIsShowing = YES; 218 weakSelf.faceUView.beautyConfigViewIsShowing = YES;
@@ -310,7 +314,6 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat @@ -310,7 +314,6 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
310 if (extra == 1){//停止录制 314 if (extra == 1){//停止录制
311 315
312 [weakSelf.timesArr addObject:[NSString stringWithFormat:@"%d", weakSelf.tempTime]]; 316 [weakSelf.timesArr addObject:[NSString stringWithFormat:@"%d", weakSelf.tempTime]];
313 - NSLog(@"timesArr======%@---%d----%d",weakSelf.timesArr, weakSelf.tempTime, weakSelf.count);  
314 317
315 [weakSelf.recordTimer setFireDate:[NSDate distantFuture]]; 318 [weakSelf.recordTimer setFireDate:[NSDate distantFuture]];
316 319
@@ -433,9 +436,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat @@ -433,9 +436,7 @@ UIImagePickerControllerDelegate, BeautyConfigViewDelegate, FaceUFiterViewDelegat
433 - (void)onCountUp:(NSTimer *)sender 436 - (void)onCountUp:(NSTimer *)sender
434 { 437 {
435 self.count ++; 438 self.count ++;
436 - self.tempTime ++;  
437 - NSLog(@"tempTime--------%d", _tempTime);  
438 - 439 + self.tempTime ++;
439 self.timeLab.text = [NSString stringWithFormat:@"%02d:%02d",self.count/60,self.count%60]; 440 self.timeLab.text = [NSString stringWithFormat:@"%02d:%02d",self.count/60,self.count%60];
440 } 441 }
441 442
LiveVideoCloud/Classes/Sections/Mine/Controllers/LVCShortVideoListViewController.m
@@ -113,6 +113,10 @@ @@ -113,6 +113,10 @@
113 [weakSelf.videoCfgView removeFromSuperview]; 113 [weakSelf.videoCfgView removeFromSuperview];
114 } else { 114 } else {
115 115
  116 + MBProgressHUD *progressHud = [MBProgressHUD showHUDAddedTo:weakSelf.view animated:YES];
  117 + progressHud.mode = MBProgressHUDModeIndeterminate;
  118 +
  119 +
116 //鉴权 120 //鉴权
117 [[CNLiveMediaEditor shareInstance] registerCNMediaEditorKit:^(NSString *maxDuration) { 121 [[CNLiveMediaEditor shareInstance] registerCNMediaEditorKit:^(NSString *maxDuration) {
118 122
@@ -123,13 +127,21 @@ @@ -123,13 +127,21 @@
123 [weakSelf presentViewController:cfgVC animated:YES completion:NULL]; 127 [weakSelf presentViewController:cfgVC animated:YES completion:NULL];
124 [weakSelf.videoCfgView removeFromSuperview]; 128 [weakSelf.videoCfgView removeFromSuperview];
125 129
  130 + [MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
126 }); 131 });
127 132
  133 +
128 } failure:^(NSDictionary *errorDic) { 134 } failure:^(NSDictionary *errorDic) {
129 135
130 - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"鉴权失败, 请重试!" delegate:nil cancelButtonTitle:@"好 的" otherButtonTitles:nil, nil];  
131 - [alertView show];  
132 - [weakSelf.videoCfgView removeFromSuperview]; 136 + dispatch_async(dispatch_get_main_queue(), ^{
  137 +
  138 + [MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
  139 +
  140 + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:nil message:@"鉴权失败, 请重试!" delegate:nil cancelButtonTitle:@"好 的" otherButtonTitles:nil, nil];
  141 + [alertView show];
  142 + [weakSelf.videoCfgView removeFromSuperview];
  143 + });
  144 +
133 }]; 145 }];
134 146
135 } 147 }
LiveVideoCloud/Classes/Sections/Mine/Views/LVCEditorBottomView.m
@@ -52,22 +52,23 @@ @@ -52,22 +52,23 @@
52 #pragma mark - 52 #pragma mark -
53 #pragma mark - Action 53 #pragma mark - Action
54 - (void)editorBtnClick:(UIButton *)btn { 54 - (void)editorBtnClick:(UIButton *)btn {
55 -// self.editorBtn.selected = YES;  
56 - btn.selected = !btn.selected; 55 + _editorBtn.selected = YES;
  56 + _funcBtn.selected = NO;
  57 + _filterBtn.selected = NO;
57 _scrollView.contentOffset = CGPointMake(0, 0); 58 _scrollView.contentOffset = CGPointMake(0, 0);
58 } 59 }
59 60
60 - (void)funcBtnClick:(UIButton *)btn { 61 - (void)funcBtnClick:(UIButton *)btn {
61 -// self.funcBtn.selected = YES;  
62 - btn.selected = !btn.selected;  
63 - 62 + _editorBtn.selected = NO;
  63 + _funcBtn.selected = YES;
  64 + _filterBtn.selected = NO;
64 _scrollView.contentOffset = CGPointMake(KScreenWidth, 0); 65 _scrollView.contentOffset = CGPointMake(KScreenWidth, 0);
65 } 66 }
66 67
67 - (void)filterBtnClick:(UIButton *)btn { 68 - (void)filterBtnClick:(UIButton *)btn {
68 -// self.filterBtn.selected = YES;  
69 - btn.selected = !btn.selected;  
70 - 69 + _editorBtn.selected = NO;
  70 + _funcBtn.selected = NO;
  71 + _filterBtn.selected = YES;
71 _scrollView.contentOffset = CGPointMake(KScreenWidth*2, 0); 72 _scrollView.contentOffset = CGPointMake(KScreenWidth*2, 0);
72 } 73 }
73 74
@@ -107,9 +108,9 @@ @@ -107,9 +108,9 @@
107 if (!_filterBtn) { 108 if (!_filterBtn) {
108 _filterBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 109 _filterBtn = [UIButton buttonWithType:UIButtonTypeCustom];
109 _filterBtn.frame = CGRectMake(BTN_WIDTH*5, 10, BTN_WIDTH, BTN_WIDTH); 110 _filterBtn.frame = CGRectMake(BTN_WIDTH*5, 10, BTN_WIDTH, BTN_WIDTH);
110 - [_filterBtn setImage:[UIImage imageNamed:@"filter normal"] forState:UIControlStateNormal];  
111 - [_filterBtn setImage:[UIImage imageNamed:@"filter selested"] forState:UIControlStateHighlighted];  
112 [_filterBtn addTarget:self action:@selector(filterBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 111 [_filterBtn addTarget:self action:@selector(filterBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  112 + [_filterBtn setImage:[UIImage imageNamed:@"filter_normal"] forState:UIControlStateNormal];
  113 + [_filterBtn setImage:[UIImage imageNamed:@"filter_selected"] forState:UIControlStateSelected];
113 } 114 }
114 return _filterBtn; 115 return _filterBtn;
115 } 116 }
@@ -119,9 +120,9 @@ @@ -119,9 +120,9 @@
119 if (!_funcBtn) { 120 if (!_funcBtn) {
120 _funcBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 121 _funcBtn = [UIButton buttonWithType:UIButtonTypeCustom];
121 _funcBtn.frame = CGRectMake(BTN_WIDTH*3, 10, BTN_WIDTH, BTN_WIDTH); 122 _funcBtn.frame = CGRectMake(BTN_WIDTH*3, 10, BTN_WIDTH, BTN_WIDTH);
122 - [_funcBtn setImage:[UIImage imageNamed:@"more normal"] forState:UIControlStateNormal];  
123 - [_funcBtn setImage:[UIImage imageNamed:@"more selested"] forState:UIControlStateSelected];  
124 [_funcBtn addTarget:self action:@selector(funcBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 123 [_funcBtn addTarget:self action:@selector(funcBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  124 + [_funcBtn setImage:[UIImage imageNamed:@"func_normal"] forState:UIControlStateNormal];
  125 + [_funcBtn setImage:[UIImage imageNamed:@"func_selected"] forState:UIControlStateSelected];
125 } 126 }
126 return _funcBtn; 127 return _funcBtn;
127 } 128 }
@@ -131,9 +132,9 @@ @@ -131,9 +132,9 @@
131 if (!_editorBtn) { 132 if (!_editorBtn) {
132 _editorBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 133 _editorBtn = [UIButton buttonWithType:UIButtonTypeCustom];
133 _editorBtn.frame = CGRectMake(BTN_WIDTH, 10, BTN_WIDTH, BTN_WIDTH); 134 _editorBtn.frame = CGRectMake(BTN_WIDTH, 10, BTN_WIDTH, BTN_WIDTH);
134 - [_editorBtn setImage:[UIImage imageNamed:@"editor normal"] forState:UIControlStateNormal];  
135 - [_editorBtn setImage:[UIImage imageNamed:@"editor selested"] forState:UIControlStateSelected];  
136 [_editorBtn addTarget:self action:@selector(editorBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 135 [_editorBtn addTarget:self action:@selector(editorBtnClick:) forControlEvents:UIControlEventTouchUpInside];
  136 + [_editorBtn setImage:[UIImage imageNamed:@"editor normal"] forState:UIControlStateNormal];
  137 + [_editorBtn setImage:[UIImage imageNamed:@"editor_selected"] forState:UIControlStateSelected];
137 _editorBtn.selected = YES; 138 _editorBtn.selected = YES;
138 } 139 }
139 return _editorBtn; 140 return _editorBtn;
LiveVideoCloud/Classes/Sections/Mine/Views/LVCPreviewView.m
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 #pragma mark - 37 #pragma mark -
38 #pragma mark - Action 38 #pragma mark - Action
39 - (void)onClick:(UIButton *)sender 39 - (void)onClick:(UIButton *)sender
40 -{ 40 +{
41 if (self.onEvent){ 41 if (self.onEvent){
42 self.onEvent(sender.tag, 0); 42 self.onEvent(sender.tag, 0);
43 } 43 }
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
101 - (UIButton *)closeBtn 101 - (UIButton *)closeBtn
102 { 102 {
103 if (!_closeBtn){ 103 if (!_closeBtn){
104 - _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 104 + _closeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
105 _closeBtn.frame = CGRectMake(15, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH); 105 _closeBtn.frame = CGRectMake(15, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH);
106 _closeBtn.tag = PreViewSubViewIdx_Close; 106 _closeBtn.tag = PreViewSubViewIdx_Close;
107 [_closeBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside]; 107 [_closeBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
@@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@
113 - (UIButton *)beautyBtn 113 - (UIButton *)beautyBtn
114 { 114 {
115 if (!_beautyBtn){ 115 if (!_beautyBtn){
116 - _beautyBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 116 + _beautyBtn = [UIButton buttonWithType:UIButtonTypeCustom];
117 _beautyBtn.frame = CGRectMake(self.closeBtn.right+SPACE, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH); 117 _beautyBtn.frame = CGRectMake(self.closeBtn.right+SPACE, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH);
118 _beautyBtn.tag = PreViewSubViewIdx_Beauty; 118 _beautyBtn.tag = PreViewSubViewIdx_Beauty;
119 [_beautyBtn addTarget:self action:@selector(beautyBtnClick:) forControlEvents:UIControlEventTouchUpInside]; 119 [_beautyBtn addTarget:self action:@selector(beautyBtnClick:) forControlEvents:UIControlEventTouchUpInside];
@@ -125,7 +125,7 @@ @@ -125,7 +125,7 @@
125 - (UIButton *)flashBtn 125 - (UIButton *)flashBtn
126 { 126 {
127 if (!_flashBtn){ 127 if (!_flashBtn){
128 - _flashBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 128 + _flashBtn = [UIButton buttonWithType:UIButtonTypeCustom];
129 _flashBtn.frame = CGRectMake(self.beautyBtn.right+SPACE, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH); 129 _flashBtn.frame = CGRectMake(self.beautyBtn.right+SPACE, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH);
130 _flashBtn.tag = PreViewSubViewIdx_Flash; 130 _flashBtn.tag = PreViewSubViewIdx_Flash;
131 [_flashBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside]; 131 [_flashBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
@@ -150,7 +150,7 @@ @@ -150,7 +150,7 @@
150 - (UIButton *)funcBtn 150 - (UIButton *)funcBtn
151 { 151 {
152 if (!_funcBtn){ 152 if (!_funcBtn){
153 - _funcBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 153 + _funcBtn = [UIButton buttonWithType:UIButtonTypeCustom];
154 _funcBtn.frame = CGRectMake(self.toggleCameraBtn.right+SPACE, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH); 154 _funcBtn.frame = CGRectMake(self.toggleCameraBtn.right+SPACE, 18, TOP_ICON_WIDTH, TOP_ICON_WIDTH);
155 _funcBtn.tag = PreViewSubViewIdx_Function; 155 _funcBtn.tag = PreViewSubViewIdx_Function;
156 [_funcBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside]; 156 [_funcBtn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
LiveVideoCloud/UtilKits/Category/UIColor+HexString.m
@@ -92,9 +92,9 @@ @@ -92,9 +92,9 @@
92 } 92 }
93 93
94 94
95 -+ (UIColor *)yellowColorCNLive// 95 ++ (UIColor *)yellowColorCNLive
96 { 96 {
97 - return [self colorWithHexString:@"fff100"];// 97 + return [self colorWithHexString:@"ffba00"]; //fff100
98 } 98 }
99 99
100 + (UIColor *)redColorCNLive 100 + (UIColor *)redColorCNLive
LiveVideoCloud/animation.xcassets/ShortVideo/ more selected.imageset/ more selected.png deleted 100644 → 0

5 KB

LiveVideoCloud/animation.xcassets/ShortVideo/editor selected.imageset/editor selected.png deleted 100644 → 0

2.32 KB

LiveVideoCloud/animation.xcassets/ShortVideo/ more selected.imageset/Contents.json renamed to LiveVideoCloud/animation.xcassets/ShortVideo/editor_selected.imageset/Contents.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "images" : [ 2 "images" : [
3 { 3 {
4 "idiom" : "universal", 4 "idiom" : "universal",
5 - "filename" : " more selected.png", 5 + "filename" : "editor_selected.png",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
LiveVideoCloud/animation.xcassets/ShortVideo/editor_selected.imageset/editor_selected.png 0 → 100644

606 Bytes

LiveVideoCloud/animation.xcassets/ShortVideo/filter normal.imageset/filter normal.png deleted 100644 → 0

7.01 KB

LiveVideoCloud/animation.xcassets/ShortVideo/filter selected.imageset/filter selected.png deleted 100644 → 0

7.28 KB

LiveVideoCloud/animation.xcassets/ShortVideo/editor selected.imageset/Contents.json renamed to LiveVideoCloud/animation.xcassets/ShortVideo/filter_normal.imageset/Contents.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "images" : [ 2 "images" : [
3 { 3 {
4 "idiom" : "universal", 4 "idiom" : "universal",
5 - "filename" : "editor selected.png", 5 + "filename" : "filter_normal.png",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
LiveVideoCloud/animation.xcassets/ShortVideo/filter_normal.imageset/filter_normal.png 0 → 100644

2.08 KB

LiveVideoCloud/animation.xcassets/ShortVideo/filter normal.imageset/Contents.json renamed to LiveVideoCloud/animation.xcassets/ShortVideo/filter_selected.imageset/Contents.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "images" : [ 2 "images" : [
3 { 3 {
4 "idiom" : "universal", 4 "idiom" : "universal",
5 - "filename" : "filter normal.png", 5 + "filename" : "filter_selected.png",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
LiveVideoCloud/animation.xcassets/ShortVideo/filter_selected.imageset/filter_selected.png 0 → 100644

2.04 KB

LiveVideoCloud/animation.xcassets/ShortVideo/filter selected.imageset/Contents.json renamed to LiveVideoCloud/animation.xcassets/ShortVideo/func_normal.imageset/Contents.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "images" : [ 2 "images" : [
3 { 3 {
4 "idiom" : "universal", 4 "idiom" : "universal",
5 - "filename" : "filter selected.png", 5 + "filename" : "func_normal.png",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
LiveVideoCloud/animation.xcassets/ShortVideo/func_normal.imageset/func_normal.png 0 → 100644

930 Bytes

LiveVideoCloud/animation.xcassets/ShortVideo/more normal.imageset/Contents.json renamed to LiveVideoCloud/animation.xcassets/ShortVideo/func_selected.imageset/Contents.json
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 "images" : [ 2 "images" : [
3 { 3 {
4 "idiom" : "universal", 4 "idiom" : "universal",
5 - "filename" : "more normal.png", 5 + "filename" : "func_selected.png",
6 "scale" : "1x" 6 "scale" : "1x"
7 }, 7 },
8 { 8 {
LiveVideoCloud/animation.xcassets/ShortVideo/func_selected.imageset/func_selected.png 0 → 100644

886 Bytes

LiveVideoCloud/animation.xcassets/ShortVideo/more normal.imageset/more normal.png deleted 100644 → 0

4.89 KB