Hi All,

I am trying to add MPMoviePlayerController to my app and for some reason I get 
just the blank screen.
Here is what I do:

    public  class VideoPlayerController : UIViewController
    {

        public VideoPlayerController() : base(null, null)
        {
            _videoFileUrl = NSUrl.FromFilename("Movies/file.m4v");

            
NSNotificationCenter.DefaultCenter.AddObserver("MPMoviePlayerWillExitFullscreenNotification",
 MoviePlayerDone);
            _player = new MPMoviePlayerController(_videoFileUrl) { 
AllowsAirPlay = true };

             //Add the MPMoviePlayerController View

             this.View.AddSubview(_player.View);
        }


        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            _player.SetFullscreen(true, true);

            _player.PrepareToPlay();
            _player.Play();
        }


        /// <summary>
        /// Handler for "Done" button click inside the player
        /// </summary>
        private void MoviePlayerDone(NSNotification obj)

        {
            this.ParentViewController.DismissModalViewControllerAnimated(true);
        }
   } 


What have I done wrong?

Thank you guys.

Cheers,
Andre
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to