I'm using MediaPlugin in my Xamarin.Forms application to take/upload photos and videos.
Taking photos and uploading photos & videos from gallery works for all platforms (iOS, Android, UWP) on all devices I tested it on.
Video recording works on most Android devices but two - LG Nexus 5 and Samsung Galaxy S8 Plus.
On LG Nexus 5, Android - 6.0 - video recording process looks as usual but after stop and pressing "ok" buttonCrossMedia.Current.TakeVideoAsync()
fails withPlugin.Media.Abstractions.MediaFileNotFoundException: Unable to locate media file at content://media/external/video/media/8852
On Samsung Galaxy S8 Plus (Android - 8.0, Samsung Experience - 9.0) - again, video recording process looks as usual but after stop it shows message Camera has stopped. Open app again
on device screen and TakeVideoAsync()
returns null
. I.e. it doesn't crash but returns null
instead of MediaFile instance.
Android devices where it works:
Sony XPeria X Performance (F8132), Android 8.0
Sony XPeria M4 (E2303), Android 5.0
Samsung Galaxy Tab S, Android 6.0.1
Version of MediaPlugin: 4.0.1.5
Version of Xamarin: 4.0.0.425677
Snippet with code that crashes:
return await CrossMedia.Current.TakeVideoAsync(new StoreVideoOptions { Name = "movie.mp4", SaveToAlbum = true, // or false, doesn't matter here DefaultCamera = CameraDevice.Rear, Quality = VideoQuality.Medium });
Did anyone experience the same issue?
Answers
I have the same error.
Have you found the solution?