Problems with background video in Storyboard in Xamarin iOS (not in Xamarin Forms)

1

I need to insert a video background of my application (Login).

I'm using this code in the ViewDidLoad method

            MPMoviePlayerController mpPlayer;
            mpPlayer = new MPMoviePlayerController (NSUrl.FromFilename 
                                        ("imagenes/login/video_login.mp4"));

            mpPlayer.ControlStyle = MPMovieControlStyle.None;
            mpPlayer.ScalingMode = MPMovieScalingMode.AspectFill;
            mpPlayer.ControlStyle = MPMovieControlStyle.None;

            fondoLogin.Add (mpPlayer.View);
            //fondoLogin.AddSubview (mpPlayer.View);

            mpPlayer.View.Frame = new CGRect (0, 0, View.Frame.Width,View.Frame.Height);

            mpPlayer.SourceType = MPMovieSourceType.Streaming;
            mpPlayer.SetFullscreen (true, true);
            mpPlayer.PrepareToPlay ();
            mpPlayer.ShouldAutoplay = true;
            videoEndNotificationToken = NSNotificationCenter.DefaultCenter.AddObserver
                                                            (AVPlayerItem.DidPlayToEndTimeNotification, VideoDidFinishPlaying, mpPlayer);
            mpPlayer.RepeatMode = MPMovieRepeatMode.One;
            mpPlayer.Play ();

It does not show the video that I put in the resources folder of my project. The video is in mp4 format

PS: I'm building on iOS 11 and I want my login to look like Spotify.

    
asked by Gabriel Soto Valenzuela 22.02.2018 в 12:50
source

0 answers