|
@@ -36,7 +36,6 @@
|
|
|
|
|
|
//其它
|
|
//其它
|
|
#import "AVAsset+VideoInfo.h"
|
|
#import "AVAsset+VideoInfo.h"
|
|
-#import "AliAssetImageGenerator.h"
|
|
|
|
#import "AliyunCustomFilter.h"
|
|
#import "AliyunCustomFilter.h"
|
|
#import "AliyunEffectFilterView.h"
|
|
#import "AliyunEffectFilterView.h"
|
|
#import "AliyunMusicPickViewController.h"
|
|
#import "AliyunMusicPickViewController.h"
|
|
@@ -53,7 +52,6 @@
|
|
typedef enum : NSUInteger {
|
|
typedef enum : NSUInteger {
|
|
AlivcEditVCStatus_Normal = 0, //播放或者暂停状态 - 非编辑状态
|
|
AlivcEditVCStatus_Normal = 0, //播放或者暂停状态 - 非编辑状态
|
|
AlivcEditVCStatus_Edit, //编辑状态
|
|
AlivcEditVCStatus_Edit, //编辑状态
|
|
-
|
|
|
|
} AlivcEditVCStatus;
|
|
} AlivcEditVCStatus;
|
|
|
|
|
|
// TODO:此类需再抽一层,否则会太庞大
|
|
// TODO:此类需再抽一层,否则会太庞大
|
|
@@ -542,28 +540,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
[self playButtonTouchedHandle];
|
|
[self playButtonTouchedHandle];
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- 取消按钮点击响应
|
|
|
|
- 1.不应用特效 - 去除预览中的特效
|
|
|
|
- 2.退出编辑模式
|
|
|
|
- */
|
|
|
|
-- (void)cancel {
|
|
|
|
-
|
|
|
|
- // 2
|
|
|
|
- [self quitEditWithActionType:_editSouceClickType CompletionHandle:nil];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- 保存按钮点击响应
|
|
|
|
- 1.应用特效
|
|
|
|
- 2.退出编辑模式
|
|
|
|
- */
|
|
|
|
-- (void)apply {
|
|
|
|
- // 2
|
|
|
|
-
|
|
|
|
- [self quitEditWithActionType:_editSouceClickType CompletionHandle:nil];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
返回
|
|
返回
|
|
*/
|
|
*/
|
|
@@ -574,26 +550,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
}
|
|
}
|
|
|
|
|
|
-- (UIImage *)featchFirstFrame {
|
|
|
|
- NSArray *clips = [self.clipConstructor mediaClips];
|
|
|
|
- AliyunClip *firstClip = clips.firstObject;
|
|
|
|
- if (firstClip) {
|
|
|
|
- AliAssetInfo *info = [[AliAssetInfo alloc] init];
|
|
|
|
- info.path = firstClip.src;
|
|
|
|
- info.duration = firstClip.duration;
|
|
|
|
- info.animDuration = 0;
|
|
|
|
- info.startTime = firstClip.startTime;
|
|
|
|
- if (firstClip.mediaType == AliyunClipVideo) {
|
|
|
|
- info.type = AliAssetInfoTypeVideo;
|
|
|
|
- } else {
|
|
|
|
- info.type = AliAssetInfoTypeImage;
|
|
|
|
- }
|
|
|
|
- UIImage *image = [info captureImageAtTime:0 outputSize:_outputSize];
|
|
|
|
- return image;
|
|
|
|
- }
|
|
|
|
- return nil;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
发布
|
|
发布
|
|
*/
|
|
*/
|
|
@@ -809,7 +765,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
CGFloat animationTime = 0.2f;
|
|
CGFloat animationTime = 0.2f;
|
|
BOOL canEditFrame = [self isEditFrameType:type];
|
|
BOOL canEditFrame = [self isEditFrameType:type];
|
|
if (canEditFrame) {
|
|
if (canEditFrame) {
|
|
- [self p_changeUIToEnterEditFrameModeCompletionHandle:completion];
|
|
|
|
[self pause];
|
|
[self pause];
|
|
} else {
|
|
} else {
|
|
[self p_presentBackgroundButton];
|
|
[self p_presentBackgroundButton];
|
|
@@ -839,7 +794,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
|
|
|
|
BOOL canEditFrame = [self isEditFrameType:type];
|
|
BOOL canEditFrame = [self isEditFrameType:type];
|
|
if (canEditFrame) {
|
|
if (canEditFrame) {
|
|
- [self p_changeUIToQuitEditFrameMode];
|
|
|
|
[self resume];
|
|
[self resume];
|
|
} else {
|
|
} else {
|
|
[self p_dismissBackgroundButton];
|
|
[self p_dismissBackgroundButton];
|
|
@@ -965,55 +919,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
}];
|
|
}];
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- 让界面进入能编辑视频帧的模式
|
|
|
|
- */
|
|
|
|
-- (void)p_changeUIToEnterEditFrameModeCompletionHandle:(void (^__nullable)(BOOL finished))completion {
|
|
|
|
- self.backButton.hidden = YES;
|
|
|
|
- self.publishButton.hidden = YES;
|
|
|
|
- CGRect editFrame = [self editStatusFrameMovieView];
|
|
|
|
-
|
|
|
|
- [UIView animateWithDuration:0.2
|
|
|
|
- animations:^{
|
|
|
|
- self.movieView.frame = editFrame;
|
|
|
|
- } completion:^(BOOL finished) {
|
|
|
|
-
|
|
|
|
- if (completion) {
|
|
|
|
- completion(finished);
|
|
|
|
- }
|
|
|
|
- }];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- 界面退出编辑模式
|
|
|
|
- */
|
|
|
|
-- (void)p_changeUIToQuitEditFrameMode {
|
|
|
|
- self.backButton.hidden = NO;
|
|
|
|
- self.publishButton.hidden = NO;
|
|
|
|
- [self p_setMovieViewFrameToPlayStatusWithAnimation];
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- 编辑模式下的frame大小
|
|
|
|
-
|
|
|
|
- @return 编辑模式下的frame大小
|
|
|
|
- */
|
|
|
|
-- (CGRect)editStatusFrameMovieView {
|
|
|
|
- CGFloat yToTop = SafeTop + 8;
|
|
|
|
-
|
|
|
|
- UIView *editView = [self editViewWithType:_editSouceClickType];
|
|
|
|
- CGFloat mHeight = ScreenHeight - editView.frame.size.height - yToTop - 2;
|
|
|
|
- CGFloat factor = _outputSize.width / _outputSize.height;
|
|
|
|
- CGFloat mWidth = factor * mHeight;
|
|
|
|
- if (mWidth > ScreenWidth) {
|
|
|
|
- mWidth = ScreenWidth;
|
|
|
|
- mHeight = 1 / factor * mWidth;
|
|
|
|
- }
|
|
|
|
- CGFloat mx = (ScreenWidth - mWidth) / 2;
|
|
|
|
- CGFloat my = yToTop;
|
|
|
|
- return CGRectMake(mx, my, ceilf(mWidth), ceilf(mHeight));
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
- (CGRect)playStatusFrameMovieView {
|
|
- (CGRect)playStatusFrameMovieView {
|
|
CGFloat factor = _outputSize.height / _outputSize.width;
|
|
CGFloat factor = _outputSize.height / _outputSize.width;
|
|
CGFloat y = ScreenWidth / 8 + SafeTop;
|
|
CGFloat y = ScreenWidth / 8 + SafeTop;
|
|
@@ -1039,18 +944,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
self.movieView.frame = [self playStatusFrameMovieView];
|
|
self.movieView.frame = [self playStatusFrameMovieView];
|
|
|
|
|
|
}
|
|
}
|
|
-/**
|
|
|
|
- 让播放视图回归正常的大小-以动画的形式
|
|
|
|
- */
|
|
|
|
-- (void)p_setMovieViewFrameToPlayStatusWithAnimation {
|
|
|
|
- CGRect targetFrame = [self playStatusFrameMovieView];
|
|
|
|
- [UIView animateWithDuration:0.2
|
|
|
|
- animations:^{
|
|
|
|
- self.movieView.frame = targetFrame;
|
|
|
|
- } completion:^(BOOL finished) {
|
|
|
|
-
|
|
|
|
- }];
|
|
|
|
-}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
添加背景按钮
|
|
添加背景按钮
|
|
@@ -1084,7 +977,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
- (void)playerDidEnd {
|
|
- (void)playerDidEnd {
|
|
|
|
|
|
if (_processAnimationFilter) { //如果当前有正在添加的动效滤镜 则pause
|
|
if (_processAnimationFilter) { //如果当前有正在添加的动效滤镜 则pause
|
|
- // [self.player replay];
|
|
|
|
[self updateUIAndDataWhenPlayStatusChanged];
|
|
[self updateUIAndDataWhenPlayStatusChanged];
|
|
_processAnimationFilter.endTime = [self.player getDuration];
|
|
_processAnimationFilter.endTime = [self.player getDuration];
|
|
_processAnimationFilter.streamEndTime = [self.player getStreamDuration];
|
|
_processAnimationFilter.streamEndTime = [self.player getStreamDuration];
|
|
@@ -1093,7 +985,6 @@ AliyunIExporterCallback, AliyunIPlayerCallback, AliyunMusicPickViewControllerDel
|
|
[self.player replay];
|
|
[self.player replay];
|
|
[self updateUIAndDataWhenPlayStatusChanged];
|
|
[self updateUIAndDataWhenPlayStatusChanged];
|
|
self.isExporting = NO;
|
|
self.isExporting = NO;
|
|
- // [self forceFinishLastEditPasterView];
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|