Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET 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:
Version of Xamarin:

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?


Sign In or Register to comment.