The UIVideoEditorController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private; do not modify the view hierarchy. This class does not support modifications to its appearance by use of overlay views.
1importUIKit23classViewController:UIViewController,UINavigationControllerDelegate,UIVideoEditorControllerDelegate{45let _videoEditor =UIVideoEditorController()67overridefuncviewDidLoad(){8super.viewDidLoad()9// Do any additional setup after loading the view, typically from a nib.10}1112overridefuncviewDidAppear(animated:Bool){13// 動画ファイルのパスを取得し、設定14let _videoPath =NSBundle.mainBundle().pathForResource("test", ofType:"mov")15 _videoEditor.videoPath = _videoPath!16// トリミングの最大時間設定17 _videoEditor.videoMaximumDuration =3018// 画質設定19 _videoEditor.videoQuality =.TypeMedium2021 _videoEditor.delegate =self22presentViewController(_videoEditor, animated:true, completion:{})23}2425overridefuncdidReceiveMemoryWarning(){26super.didReceiveMemoryWarning()27// Dispose of any resources that can be recreated.28}2930// トリミングした動画ファイルのパスを取得31funcvideoEditorController(editor:UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath:String){32print("editedVideoPath: \(editedVideoPath)")33}34// 失敗時の処理35funcvideoEditorController(editor:UIVideoEditorController, didFailWithError error:NSError){36print("error: \(error)")37}38// キャンセル時の処理39funcvideoEditorControllerDidCancel(editor:UIVideoEditorController){40}4142}
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/12/25 00:35
2015/12/26 08:29
2015/12/26 11:26
2015/12/26 13:43