You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It pretends like a file is created in some temporary directory (where files will be deleted at some point) by using a function with name getTemporaryFilePathWithExtension. But that function actually uses NSDocumentDirectory and the path can look like "/var/mobile/Containers/Data/Application/{some_id}/Documents/camera/videos" which looks like a persistent directory specific for the app. So it is a good idea to delete generated videos on the dart side at some point (maybe good to at least document this?), otherwise it will eventually fill the entire storage and one would need to delete and reinstall the app. Problem is that the recorded file is obtained by calling stopVideoRecordingWithCompletion and if some error happens before this or during a call to it then it is not possible to obtain that file on the dart side. Currently a workaround could be to use some plugin like path_provider and use hard coded path generation in a similar way as camera_avfoundation does (for example to clear that folder in case of error), which is prone to problems if something changes. Maybe camera_avfoundation should really rather use some temporary folder or prevent these leaks by some other means.
Also when stopVideoRecordingWithCompletion fails it updates internal state in camera_avfoundation about recording to false but on the dart side in camera this is not updated. So trying to record something in this state will throw "Unhandled Exception: CameraException(A video recording is already started., startVideoRecording was called when a recording is already started.)" and on the other hand trying to stop recording throws "CameraException(Error -1008, Video is not recording!)".
It pretends like a file is created in some temporary directory (where files will be deleted at some point) by using a function with name
getTemporaryFilePathWithExtension. But that function actually usesNSDocumentDirectoryand the path can look like "/var/mobile/Containers/Data/Application/{some_id}/Documents/camera/videos" which looks like a persistent directory specific for the app. So it is a good idea to delete generated videos on the dart side at some point (maybe good to at least document this?), otherwise it will eventually fill the entire storage and one would need to delete and reinstall the app. Problem is that the recorded file is obtained by callingstopVideoRecordingWithCompletionand if some error happens before this or during a call to it then it is not possible to obtain that file on the dart side. Currently a workaround could be to use some plugin likepath_providerand use hard coded path generation in a similar way ascamera_avfoundationdoes (for example to clear that folder in case of error), which is prone to problems if something changes. Maybecamera_avfoundationshould really rather use some temporary folder or prevent these leaks by some other means.Also when
stopVideoRecordingWithCompletionfails it updates internal state incamera_avfoundationabout recording to false but on the dart side incamerathis is not updated. So trying to record something in this state will throw "Unhandled Exception: CameraException(A video recording is already started., startVideoRecording was called when a recording is already started.)" and on the other hand trying to stop recording throws "CameraException(Error -1008, Video is not recording!)".