Forum Xamarin.iOS

MPMoviePlayerController can't play video on device

SafakktemSafakktem USMember ✭✭
edited November 2015 in Xamarin.iOS

Hi Everyone,

On my Iphone5s with "http://movietrailers.apple.com/movies/paramount/anomalisa/anomalisa-tlr1_i320.m4v" play video fine.
when i put same video on my server "http://isaretservis.idealbilisim.net/IsaretResources/Videos/anomalisa-tlr1_i320.m4v" can not play on device.
I have tried many different servers and many different extension "m4p,mp4,3gp".

var url = new NSUrl("http://isaretservis.idealbilisim.net/IsaretResources/Videos/anomalisa-tlr1_i320.m4v");
            moviePlayer = new MPMoviePlayerController();
            moviePlayer.ContentUrl = url;
            moviePlayer.View.Frame = new CGRect((float)((View.Bounds.Width - 600) / 2), (float)((View.Bounds.Height - 450) / 2), 600, 400);

            MPMoviePlayerController.Notifications.ObserveLoadStateDidChange(OnLoadStateChanged);
            MPMoviePlayerController.Notifications.ObservePlaybackDidFinish(OnPlaybackComplete);

            View.AddSubview(moviePlayer.View);

            moviePlayer.PrepareToPlay();
            moviePlayer.ShouldAutoplay = true;
            moviePlayer.Play();

Where am I doing wrong?

Answers

Sign In or Register to comment.