Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

MediaPlugin video recording doesn't work on Samsung SM-G950FD and LG Nexus 5

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" button
CrossMedia.Current.TakeVideoAsync() fails with
Plugin.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

Sign In or Register to comment.