Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Record video using MediaPicker don't work on IOS

$
0
0

Hi,

I'm facing with problem when I tried to record video using MediaPicker. It works on android as expected, it opens camera view and I can record video and then hook a file. On IOS camera view don't open, moreover, it breaks taking photo view (I can take photo until I try to open record video view). My code get stuck on line:

mediaFile = await mediaPicker.TakeVideoAsync (new VideoMediaStorageOptions {
DefaultCamera = CameraDevice.Rear,
});

The whole function:

private async Task<MediaFile> takeVideo()
        {
        var mediaPicker = DependencyService.Get<IMediaPicker> ();
        MediaFile mediaFile = null;
        if (mediaPicker.IsVideosSupported && mediaPicker.IsCameraAvailable) {
            mediaFile = await mediaPicker.TakeVideoAsync (new VideoMediaStorageOptions {
                DefaultCamera = CameraDevice.Rear,
            });
        }

        return mediaFile;
    }

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>