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.