0
votes

Actually i am using MPMoviePlayerViewController in our app . And my code perfectly working in iOS 8.4 but when i upload my app into iPad (iOS 9 ) its not working ...

I am create ViewController to play two video one by one but when one video is completed or stop the controller going to my first page of app and behave unespected in iOS 9 .I am using custom MPMoviePlayerViewController to play video and put one button on first video to change other video but its not working...

NSURL *URL = [[NSBundle mainBundle] URLForResource:@"video" withExtension:@"mp4"]; self.indiaplayer = [[MPMoviePlayerController alloc] initWithContentURL:URL]; self.indiaplayer.view.frame = CGRectMake(0, 0,1024,718); [self.indiavideoThumbnail addSubview: self.indiaplayer.view]; self.indiaplayer.controlStyle = MPMovieControlStyleNone; self.indiaplayer.fullscreen = YES; self.indiaplayer.repeatMode = YES; [self.indiaplayer prepareToPlay]; self.indiaplayer.shouldAutoplay = NO;

self.indiaplaybackView = [[UIView alloc] initWithFrame:CGRectZero];
self.indiaplaybackView.backgroundColor = [UIColor colorWithRed:242.0/255 green:163.0/255 blue:10.0/255 alpha:1];
//self.playbackView.layer.cornerRadius = 2;
[indiaView addSubview:self.indiaplaybackView];


self.indiaslider.minimumValue = START;
self.indiaslider.maximumValue = END;

Thanks in advance

1
There is a very apparent lack of code here. Please fix that.David

1 Answers

1
votes

wait wait in iOS 9.x.x

IMPORTANT The MPMoviePlayerViewController class is formally deprecated in iOS 9. (The MPMoviePlayerController class is also formally deprecated.) To play video content in iOS 9 and later, instead use the AVPictureInPictureController or AVPlayerViewController class from the AVKit framework, or the WKWebView class from WebKit.

For more detail

https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPMoviePlayerViewController_class/