MustakTalukder commented on issue #506:
URL: 
https://github.com/apache/cordova-plugin-camera/issues/506#issuecomment-2029128021

   > Hi again! Here is the solution (sorry, I don't know how to open a new 
tree), to help any other user.
   > 
   > **in CDVCamera.m change THIS:**
   > 
   > * (CDVPluginResult*)resultForVideo:(NSDictionary*)info
   >   {
   >   NSString* moviePath = [[info 
objectForKey:UIImagePickerControllerMediaURL] absoluteString];
   >   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsString:filePath];
   >   }
   > 
   > **to THIS:**
   > 
   > * (CDVPluginResult*)resultForVideo:(NSDictionary*)info
   >   {
   >   NSString* moviePath = [[info 
objectForKey:UIImagePickerControllerMediaURL] path];
   >   NSArray* spliteArray = [moviePath componentsSeparatedByString: @"/"];
   >   NSString* lastString = [spliteArray lastObject];
   >   NSError *error;
   >   NSFileManager *fileManager = [NSFileManager defaultManager];
   >   NSString *documentsDirectory = [NSHomeDirectory() 
stringByAppendingPathComponent:@"tmp"];
   >   NSString *filePath = [documentsDirectory 
stringByAppendingPathComponent:lastString];
   >   [fileManager copyItemAtPath:moviePath toPath:filePath error:&error];
   >   return [CDVPluginResult resultWithStatus:CDVCommandStatus_OK 
messageAsString:filePath];
   >   }
   
   Hi All,
   - Go to your Xcode, And follow this comment, just replace the code. **It 
works for me.**
   - Go to your Xcode
   - Search for "(CDVPluginResult*)resultForVideo:(NSDictionary*)info" in your 
XCode project
   - Replace the code according to the instructions provided in this comment : 
[LINK](https://github.com/apache/cordova-plugin-camera/issues/506#issuecomment-534070130)
 
   - I have attached a photo to show you how I did it.
   - photo
   ![Screenshot 2024-04-01 at 6 04 36 
AM](https://github.com/apache/cordova-plugin-camera/assets/26258007/112d1a7f-092e-47ab-aca0-bacb54930e2a)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to