|
@@ -38,7 +38,6 @@
|
|
|
#import "AliyunTimelineView.h"
|
|
|
|
|
|
#import "AliyunCoverPickViewController.h"
|
|
|
-#import "AliyunEditButtonsView.h"
|
|
|
#import "AliyunPublishService.h"
|
|
|
|
|
|
//其它
|
|
@@ -75,7 +74,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
|
|
|
@property(nonatomic, strong) UIView *movieView;
|
|
|
@property(nonatomic, strong) AliyunTimelineView *currentTimelineView;
|
|
|
-@property(nonatomic, strong) AliyunEditButtonsView *editButtonsView;
|
|
|
@property(nonatomic, strong) UIButton *backgroundTouchButton;
|
|
|
@property(nonatomic, strong) UILabel *currentTimeLabel;
|
|
|
@property(nonatomic, strong) UIButton *playButton;
|
|
@@ -137,6 +135,10 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
|
|
|
@property(nonatomic, strong) UIButton *publishButton; //发布按钮
|
|
|
|
|
|
+@property(nonatomic, strong) UIButton *musicButton; //音乐按钮
|
|
|
+@property(nonatomic, strong) UIButton *filterButton; //滤镜按钮
|
|
|
+@property(nonatomic, strong) UIButton *speedButton; //调速按钮
|
|
|
+
|
|
|
@property(nonatomic, assign) AlivcEditVCStatus vcStatus; //界面状态
|
|
|
@property(nonatomic, strong) AliyunMusicPickModel *music; //之前应用的音乐
|
|
|
@property(nonatomic, assign) NSInteger tab; //之前应用的音乐的所属
|
|
@@ -263,9 +265,14 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
|
|
|
//发布按钮
|
|
|
[self.view addSubview:self.publishButton];
|
|
|
-
|
|
|
self.publishButton.frame = CGRectMake(ScreenWidth - 14 - 64, SafeTop + 8, 64, 26);
|
|
|
|
|
|
+ [self.view addSubview:self.musicButton];
|
|
|
+ [self.view addSubview:self.filterButton];
|
|
|
+ [self.view addSubview:self.speedButton];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
self.currentTimeLabel = [[UILabel alloc] initWithFrame:CGRectMake((ScreenWidth-60)/2, IS_IPHONEX?(SafeTop-10):0, 60, 12)];
|
|
|
self.currentTimeLabel.backgroundColor = RGBToColor(27, 33, 51);
|
|
|
self.currentTimeLabel.textColor = [UIColor whiteColor];
|
|
@@ -274,12 +281,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
self.currentTimeLabel.center = CGPointMake(ScreenWidth / 2,self.currentTimelineView.frame.origin.y + CGRectGetHeight(self.currentTimelineView.bounds) + 6);
|
|
|
[self.view addSubview:self.currentTimeLabel];
|
|
|
|
|
|
- NSArray *editModels = [AlivcEditItemManager defaultModelsWithUIConfig:_uiConfig];
|
|
|
- self.editButtonsView = [[AliyunEditButtonsView alloc] initWithModels:editModels];
|
|
|
- self.editButtonsView.frame =
|
|
|
- CGRectMake(0, ScreenHeight - 70 - SafeBottom, ScreenWidth, 70);
|
|
|
- [self.view addSubview:self.editButtonsView];
|
|
|
- self.editButtonsView.delegate = (id)self;
|
|
|
[self.view addSubview:self.playButton];
|
|
|
}
|
|
|
|
|
@@ -548,6 +549,74 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
return _publishButton;
|
|
|
}
|
|
|
|
|
|
+- (UIButton *)musicButton{
|
|
|
+ if (!_musicButton) {
|
|
|
+ _musicButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ _musicButton.backgroundColor = [UIColor clearColor];
|
|
|
+ _musicButton.frame = CGRectMake(ScreenWidth - 44 - 10, SafeTop + 64, 44, 46);
|
|
|
+ [_musicButton setImage:_uiConfig.musicImage forState:UIControlStateNormal];
|
|
|
+ [_musicButton addTarget:self action:@selector(musicButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [_musicButton setTitle:@"音乐" forState:UIControlStateNormal];
|
|
|
+ _musicButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
+ CGFloat titleHeight = _musicButton.titleLabel.intrinsicContentSize.height;
|
|
|
+ CGFloat imageWidth = _musicButton.imageView.frame.size.width;
|
|
|
+ CGFloat imageHeight = _musicButton.imageView.frame.size.height;
|
|
|
+
|
|
|
+ _musicButton.imageEdgeInsets = UIEdgeInsetsMake(0, (44 - imageWidth) * 0.5, titleHeight + 4, 0);
|
|
|
+ _musicButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
+
|
|
|
+ _musicButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
+ _musicButton.layer.shadowOpacity = 0.5;
|
|
|
+ _musicButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
|
+ }
|
|
|
+ return _musicButton;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIButton *)filterButton{
|
|
|
+ if (!_filterButton) {
|
|
|
+ _filterButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ _filterButton.backgroundColor = [UIColor clearColor];
|
|
|
+ _filterButton.frame = CGRectMake(ScreenWidth - 44 - 10, SafeTop + 130, 44, 46);
|
|
|
+ [_filterButton setImage:_uiConfig.filterImage forState:UIControlStateNormal];
|
|
|
+ [_filterButton addTarget:self action:@selector(filterButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [_filterButton setTitle:@"滤镜" forState:UIControlStateNormal];
|
|
|
+ _filterButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
+ CGFloat titleHeight = _filterButton.titleLabel.intrinsicContentSize.height;
|
|
|
+ CGFloat imageWidth = _filterButton.imageView.frame.size.width;
|
|
|
+ CGFloat imageHeight = _filterButton.imageView.frame.size.height;
|
|
|
+ _filterButton.imageEdgeInsets = UIEdgeInsetsMake(0, (44 - imageWidth) * 0.5, titleHeight + 4, 0);
|
|
|
+ _filterButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
+
|
|
|
+ _filterButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
+ _filterButton.layer.shadowOpacity = 0.5;
|
|
|
+ _filterButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
|
+ }
|
|
|
+ return _filterButton;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIButton *)speedButton{
|
|
|
+ if (!_speedButton) {
|
|
|
+ _speedButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ _speedButton.backgroundColor = [UIColor clearColor];
|
|
|
+ _speedButton.frame = CGRectMake(ScreenWidth - 44 - 10, SafeTop + 196, 44, 46);
|
|
|
+ [_speedButton setImage:[UIImage imageNamed:@"video_ico_overturn"] forState:UIControlStateNormal];
|
|
|
+ [_speedButton addTarget:self action:@selector(timeButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [_speedButton setTitle:@"调速" forState:UIControlStateNormal];
|
|
|
+ _speedButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
+ CGFloat titleHeight = _speedButton.titleLabel.intrinsicContentSize.height;
|
|
|
+ CGFloat imageWidth = _speedButton.imageView.frame.size.width;
|
|
|
+ CGFloat imageHeight = _speedButton.imageView.frame.size.height;
|
|
|
+
|
|
|
+ _speedButton.imageEdgeInsets = UIEdgeInsetsMake(0, (44 - imageWidth) * 0.5, titleHeight + 4, 0);
|
|
|
+ _speedButton.titleEdgeInsets = UIEdgeInsetsMake(imageHeight + 4, -imageWidth, 0, 0);
|
|
|
+
|
|
|
+ _speedButton.layer.shadowColor = [UIColor grayColor].CGColor;
|
|
|
+ _speedButton.layer.shadowOpacity = 0.5;
|
|
|
+ _speedButton.layer.shadowOffset = CGSizeMake(1, 1);
|
|
|
+ }
|
|
|
+ return _speedButton;
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - ButtonAction
|
|
|
|
|
|
- (void)playControlClick:(UIButton *)sender {
|
|
@@ -791,7 +860,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
*/
|
|
|
- (void)enterEditWithActionType:(AliyunEditSouceClickType)type
|
|
|
animationCompletion:(void (^__nullable)(BOOL finished))completion {
|
|
|
- self.editButtonsView.userInteractionEnabled = NO;
|
|
|
NSLog(@"多点测试:%lu", (unsigned long)type);
|
|
|
NSLog(@"多点测试:底部按钮失效");
|
|
|
_editSouceClickType = type;
|
|
@@ -961,7 +1029,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
view.frame = f;
|
|
|
} completion:^(BOOL finished) {
|
|
|
if (finished) {
|
|
|
- self.editButtonsView.userInteractionEnabled = YES;
|
|
|
NSLog(@"多点测试:底部按钮可以点击");
|
|
|
}
|
|
|
}];
|
|
@@ -1335,12 +1402,11 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
// NSLog(@"timelineEditDraggingAtTime");
|
|
|
}
|
|
|
|
|
|
-#pragma mark - 底部视图响应以及各视图代理
|
|
|
|
|
|
-#pragma mark - AliyunEditButtonsViewDelegate - 底部容器视图
|
|
|
|
|
|
+#pragma mark -
|
|
|
//滤镜
|
|
|
-- (void)filterButtonClicked:(AliyunEditMaterialType)type {
|
|
|
+- (void)filterButtonClicked {
|
|
|
[self enterEditWithActionType:AliyunEditSouceClickTypeFilter animationCompletion:nil];
|
|
|
|
|
|
if (!self.hasUesedintelligentFilter) {
|
|
@@ -1387,16 +1453,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
[self enterEditWithActionType:AliyunEditSouceClickTypeTimeFilter animationCompletion:nil];
|
|
|
}
|
|
|
|
|
|
-//封面选择
|
|
|
-- (void)coverButtonClicked {
|
|
|
- self.playButton.hidden = YES;
|
|
|
- self.currentTimelineView = self.coverSelectedView.timelineView;
|
|
|
- [self enterEditWithActionType:AliyunEditSouceClickTypeCover
|
|
|
- animationCompletion:^(BOOL finished){
|
|
|
-
|
|
|
- }];
|
|
|
-}
|
|
|
-
|
|
|
#pragma mark - AliyunEffectFilter2ViewDelegate - 滤镜
|
|
|
|
|
|
- (void)didSelectEffectFilter:(AliyunEffectFilterInfo *)filter {
|
|
@@ -1550,35 +1606,4 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
NSLog(@"----点击了-倒放");
|
|
|
}
|
|
|
|
|
|
-#pragma mark - AlivcCoverImageSelectedViewDelegate - 封面
|
|
|
-- (void)cancelCoverImageSelectedView:(AlivcCoverImageSelectedView *)view {
|
|
|
- [self quitEditWithActionType:_editSouceClickType CompletionHandle:^(BOOL finished) {
|
|
|
- self.playButton.hidden = NO;
|
|
|
- }];
|
|
|
-}
|
|
|
-
|
|
|
-- (void)applyCoverImageSelectedView:(AlivcCoverImageSelectedView *)view {
|
|
|
- //时间
|
|
|
- // CGFloat time = [self.player getCurrentStreamTime];
|
|
|
- //截图
|
|
|
- _coverImage = [self screenShotView:self.movieView];
|
|
|
- NSLog(@"图片宽度%.2f,高度%.2f",_coverImage.size.width,_coverImage.size.height);
|
|
|
- NSLog(@"视图宽度%.2f,高度%.2f",self.movieView.frame.size.width,self.movieView.frame.size.height);
|
|
|
- [self quitEditWithActionType:_editSouceClickType CompletionHandle:^(BOOL finished) {
|
|
|
- self.playButton.hidden = NO;
|
|
|
- }];
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-//传入需要截取的view
|
|
|
-- (UIImage *)screenShotView:(UIView *)view {
|
|
|
- NSLog(@"-------->view.frame:%@",NSStringFromCGRect(view.frame));
|
|
|
- UIGraphicsBeginImageContextWithOptions(view.frame.size, NO,0);
|
|
|
- [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];
|
|
|
- UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
|
|
-
|
|
|
- UIGraphicsEndImageContext();
|
|
|
- return image;
|
|
|
-}
|
|
|
-
|
|
|
@end
|