Forum Xamarin.Forms

Announcement:

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.

Play video UWP

JM9JM9 USMember ✭✭

I am using the following code to open a video in the UWP part of a Xamarin forms App.

   protected override void OnAppearing()
    {
        base.OnAppearing();

        try
        {
                var mainDir = FileSystem.AppDataDirectory;
                string filepath = Path.Combine(mainDir, "CCapture.mp4");
                if (File.Exists(filepath))
                    CrossMediaManager.Current.Play(filepath);
        }
        catch (Exception ex)
        {
            string errMessage = ex.Message;
        }

When I navigate to screen I can see the player but no video is displayed. If I use a http url it works.

Any help would be appreciated.

Answers

Sign In or Register to comment.