1 Reply
      Latest reply on Sep 26, 2015 10:54 PM by papaparsons
      Aicfrog Level 1 Level 1 (0 points)

        Hello I have tried everything to change the following code to AVPlayerView because MPMovieplayerViewController is not supported anymore in iOS 9 beta 2 and Xcode tell me to change it . I tried really everthing and I don't get it to work and apple only supports swift examples for that but I need it in Objective-C .

         

        The only thing wich is a bit complicated on it is the iad Preroll But I simple don't get it to work with the AVPlayer View.

         

        Here is the MPMovieViewController example wich works but not on iOS 9 beta 2 !

         

         

         

        NSURL*url=[NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"........." ofType:@"mp4"]];

         

            MPMoviePlayerViewController*playercontroller=[[MPMoviePlayerViewController alloc]initWithContentURL:url];

         

            [self presentMoviePlayerViewControllerAnimated:playercontroller];

         

            [playercontroller.moviePlayer playPrerollAdWithCompletionHandler:^(NSError *error)

            {

                [playercontroller.moviePlayer play];

              

              

            }];

         

            playercontroller.moviePlayer.movieSourceType=MPMovieSourceTypeFile;

         

            playercontroller=nil;

         

         

        So please can anyone help me out .

        What I have to change from that code that it will work with the AVPlayerView on iOS9 Beta 2

         

        Thanks

        With best regards Philipp