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

Video is not played in iOS project

$
0
0

Hello,

I have used Plugin.MediaManager in my Xamarin.Forms application. It works perfectly in Android project, but in iOS project it does not.

I have added

VideoViewRenderer.Init();

in AppDelegate, and this is the code in the view:

        async void PlayStop_Clicked(object sender, System.EventArgs e)
        {
            if (this.BtnPlayStop.Text == "Start Video")
            {
                string video = Path.Combine(_videoPath, this.viewModel.Item.Video);

                if (File.Exists(video))
                {
                    await CrossMediaManager.Current.Play(video, MediaFileType.Video);

                    this.BtnPlayStop.Text = "Stop Video";
                }
            }
            else
            {
                await CrossMediaManager.Current.Stop();

                this.BtnPlayStop.Text = "Start Video";
            }
        }

Code enters the first if, since button changes its text to 'Stop Video' but no video appears. The video is a local mp4 file.

As I told, this works perfect in Android.

What's wrong?

Thanks

Jaime


Viewing all articles
Browse latest Browse all 89864

Trending Articles



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