|
@@ -48,6 +48,7 @@
|
|
|
#import "AlivcEditItemModel.h"
|
|
|
|
|
|
#import "RainbowPlanet-Swift.h"
|
|
|
+#import "Masonry.h"
|
|
|
|
|
|
typedef enum : NSUInteger {
|
|
|
AlivcEditVCStatus_Normal = 0, //播放或者暂停状态 - 非编辑状态
|
|
@@ -116,6 +117,11 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
|
|
|
|
|
|
@property(nonatomic, assign) CGSize inputOutputSize;
|
|
|
|
|
|
+/**
|
|
|
+ 滤镜文字
|
|
|
+ */
|
|
|
+@property (nonatomic, strong) UILabel *effectFilterLabel;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation AliyunEditViewController {
|
|
@@ -220,6 +226,16 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
|
|
|
self.movieView.backgroundColor =
|
|
|
[[UIColor brownColor] colorWithAlphaComponent:.3];
|
|
|
[self.view addSubview:self.movieView];
|
|
|
+
|
|
|
+ self.effectFilterLabel = [UILabel new];
|
|
|
+ self.effectFilterLabel.alpha = 0;
|
|
|
+ self.effectFilterLabel.textColor = UIColor.whiteColor;
|
|
|
+ self.effectFilterLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightMedium];
|
|
|
+ [self.view addSubview:self.effectFilterLabel];
|
|
|
+ [self.effectFilterLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(@(64+SafeTop));
|
|
|
+ make.centerX.equalTo(self.view);
|
|
|
+ }];
|
|
|
|
|
|
//返回按钮
|
|
|
CGFloat y = SafeTop;
|
|
@@ -296,6 +312,14 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
|
|
|
|
|
|
[self.view addSubview:self.musicView];
|
|
|
[self.musicView addVisualEffect];
|
|
|
+
|
|
|
+ UISwipeGestureRecognizer * rightRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(rightRecognizer:)];
|
|
|
+ [rightRecognizer setDirection:(UISwipeGestureRecognizerDirectionRight)];
|
|
|
+ [self.view addGestureRecognizer:rightRecognizer];
|
|
|
+
|
|
|
+ UISwipeGestureRecognizer * leftRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(leftRecognizer:)];
|
|
|
+ [leftRecognizer setDirection:(UISwipeGestureRecognizerDirectionLeft)];
|
|
|
+ [self.view addGestureRecognizer:leftRecognizer];
|
|
|
}
|
|
|
|
|
|
// slider变动时改变播放进度
|
|
@@ -1227,7 +1251,7 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
- UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"video_exporting_finish_fail_edit",nil) message:NSLocalizedString(@"video_exporting_check_autho",nil) delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
|
|
|
+ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"video_exporting_finish_fail_edit",nil) message:NSLocalizedString(@"video_exporting_check_autho",nil) delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
|
|
|
[alert show];
|
|
|
}
|
|
|
}];
|
|
@@ -1342,10 +1366,61 @@ AliyunIExporterCallback, AliyunIPlayerCallback>
|
|
|
|
|
|
#pragma mark - AliyunEffectFilter2ViewDelegate - 滤镜
|
|
|
|
|
|
-- (void)didSelectEffectFilter:(AliyunEffectFilterInfo *)filter {
|
|
|
+/**
|
|
|
+ 右滑 减一
|
|
|
+
|
|
|
+ @param rightRecognizer 捏合方法
|
|
|
+ */
|
|
|
+- (void)rightRecognizer:(UISwipeGestureRecognizer *)rightRecognizer {
|
|
|
+ if (self.filterView.selectIndex > 0) {
|
|
|
+ self.filterView.selectIndex = self.filterView.selectIndex - 1;
|
|
|
+ }else {
|
|
|
+ self.filterView.selectIndex = self.filterView.dataArray.count - 1;
|
|
|
+ }
|
|
|
+ [self.filterView collectionView:self.filterView.collectionView didSelectItemAtIndexPath:[NSIndexPath indexPathForItem:self.filterView.selectIndex inSection:0]];
|
|
|
+ [self.filterView.collectionView reloadData];
|
|
|
+
|
|
|
+
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ 左滑 加一
|
|
|
+
|
|
|
+ @param leftRecognizer 捏合方法
|
|
|
+ */
|
|
|
+- (void)leftRecognizer:(UISwipeGestureRecognizer *)leftRecognizer {
|
|
|
+ if (self.filterView.selectIndex < self.filterView.dataArray.count-1) {
|
|
|
+ self.filterView.selectIndex = self.filterView.selectIndex + 1;
|
|
|
+ }else {
|
|
|
+ self.filterView.selectIndex = 0;
|
|
|
+ }
|
|
|
+ [self.filterView collectionView:self.filterView.collectionView didSelectItemAtIndexPath:[NSIndexPath indexPathForItem:self.filterView.selectIndex inSection:0]];
|
|
|
+ [self.filterView.collectionView reloadData];
|
|
|
+ return;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//滤镜
|
|
|
+- (void)didSelectEffectFilter:(AliyunEffectFilterInfo *)filter{
|
|
|
AliyunEffectFilter *filter2 = [[AliyunEffectFilter alloc]
|
|
|
initWithFile:[filter localFilterResourcePath]];
|
|
|
[self.editor applyFilter:filter2];
|
|
|
+
|
|
|
+ self.effectFilterLabel.alpha = 1;
|
|
|
+ self.effectFilterLabel.text = filter.name;
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
+ [UIView animateWithDuration:2 animations:^{
|
|
|
+ __strong typeof(weakSelf) strongSelf = weakSelf; //就这一句,搞定
|
|
|
+ strongSelf.effectFilterLabel.alpha = 1;
|
|
|
+ } completion:^(BOOL finished) {
|
|
|
+ __weak typeof(self) weakSelf1 = weakSelf;
|
|
|
+ [UIView animateWithDuration:2 animations:^{
|
|
|
+ __strong typeof(weakSelf1) strongSelf = weakSelf1; //就这一句,搞定
|
|
|
+ strongSelf.effectFilterLabel.alpha = 0;
|
|
|
+ } completion:^(BOOL finished) {
|
|
|
+ }];
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
#pragma mark - AliyunEffectTimeFilterDelegate - 时间特效
|