2

I'm trying to know if the video can be saved to camera roll of the Device.

I use Device -> Settings -> Privacy -> Photos to negate or give permission to save on Camera Roll.

  1. First I tried by check before to use the command mergAVSaveVideo:
on mergAVCamRecordingFinished pFile
   if mergAVCanSaveVideo(pFile) then
      answer "OK"
   else
      answer "NO"
   end if 

   mergAVSaveVideo pFile
end mergAVCamRecordingFinished

It answer me "OK" also if the video is not saved.

  1. Then I tryed to use the results:
on mergAVCamRecordingFinished pFile
   mergAVSaveVideo pFile
   answer result
end mergAVCamRecordingFinished

Here the answer dialog don't appears.

  1. Then I tried to catch the error
   try
      mergAVSaveVideo pFile
   catch e
      answer e
   end try

Here the error is always the same, whether it can save whether it can't save:

634,0,0 string conversion failed 573,13,1,mergAVSaveVideo.

Any advice?

Cue
  • 2,952
  • 3
  • 33
  • 54
  • Hmm... i think the string conversion failed error must be coming from the externals sdk... does it make any difference if you do something like: put pFile into tFile then call mergAVSaveVideo tFile? – Monte Goulding Jul 02 '13 at 06:36
  • Test done. Thanks. With permission to access camera roll: >634,0,0,string conversion failed 573,21,1,mergAVSaveVideo. Witout permission: >634,0,0,string conversion failed 573,21,1,mergAVSaveVideo. – Cue Jul 02 '13 at 08:42
  • PS if the access to the camera roll is given in the settings, the movie is saved regularly also if the error is present. – Cue Jul 02 '13 at 09:31
  • PPS I tried also passing a path of an existing video, same results: video saved and error present (the only change is the number 21 replaced with 10). – Cue Jul 02 '13 at 09:50
  • Actually the error happens after the command has done it's thing so as a temporary workaround you can just surround it in try/end try. – Monte Goulding Jul 02 '13 at 09:56
  • Thank you Monte. Yes, of course. Anyway I hope I explained myself. My problem is to know if the video is saved in the Camera Roll or not. Even better to know if I can save it or not before to try. – Cue Jul 13 '13 at 23:03

1 Answers1

1

The answer is you found a bug. Thanks! I'll release a new version of mergAV ASAP. BTW mergAVCanSaveVideo is working out if the video is compatible with the photos album UIVideoAtPathIsCompatibleWithSavedPhotosAlbum so I'll add another function for this... mergAVCanAccessPhotoLibrary...

Monte Goulding
  • 2,380
  • 1
  • 21
  • 25