I. Mpmovieplayerviewcontroller and MPMoviePlayerController districts, the former inheriting from NSObject, the latter inheriting from Uiviewcontroller
Two. Mpmovieplayerviewcontroller can only be played in the form of modal, and must be played in full screen
1 #import "ViewController.h"2 #import<MediaPlayer/MediaPlayer.h>3 4 @interfaceViewcontroller ()5 6 /*Create a playback controller*/7@property (nonatomic, strong) Mpmovieplayerviewcontroller *PLAYERVC;8-(ibaction) play;9 Ten @end One A @implementationViewcontroller - -- (void) Viewdidload { the [Super Viewdidload]; - } - - #pragmaMark-Lazy Loading code +-(Mpmovieplayerviewcontroller *) PLAYERVC - { + if(_PLAYERVC = =Nil) { ANsurl *url = [Nsurl urlwithstring:@"Http://v1.mukewang.com/19954d8f-e2c2-4c0a-b8c1-a4c826b5ca8b/L.mp4"]; at -_PLAYERVC =[[Mpmovieplayerviewcontroller alloc] initwithcontenturl:url]; - } - return_PLAYERVC; - } - in-(ibaction) play { - [self presentViewController:self.playerVc animated:yes completion:nil]; to } + - @end
iOS development--simple implementation with Mpmovieplayerviewcontroller video playback