File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -882,10 +882,16 @@ + (BOOL)requiresMainQueueSetup
882882 if ([asset isKindOfClass: [AVURLAsset class ]]) {
883883 NSURL *url = [(AVURLAsset *)asset URL ];
884884 NSLog (@" Final URL %@ " ,url);
885- NSData *videoData = [NSData dataWithContentsOfURL: url];
886-
887- BOOL writeResult = [videoData writeToFile: destination options: NSDataWritingAtomic error: &error];
888-
885+ BOOL writeResult = false ;
886+
887+ if (@available (iOS 9.0 , *)) {
888+ NSURL *destinationUrl = [NSURL fileURLWithPath: destination relativeToURL: nil ];
889+ writeResult = [[NSFileManager defaultManager ] copyItemAtURL: url toURL: destinationUrl error: &error];
890+ } else {
891+ NSData *videoData = [NSData dataWithContentsOfURL: url];
892+ writeResult = [videoData writeToFile: destination options: NSDataWritingAtomic error: &error];
893+ }
894+
889895 if (writeResult) {
890896 NSLog (@" video success" );
891897 }
You can’t perform that action at this time.
0 commit comments