Video button on the navigation bar in a ViewController and then I pressed, it will show videos immediately in portrait mode. It will only be in the scenario if I rotate it manually. How do I view video in landscape mode immediately after I press the button? I need a View Controller to look in portfolio mode and only have the video to stay in landscape mode. It ViewController.m file: Use MPMoviePlayerViewController for full screen playback and then use it "launch shouldhutatorToInterfaceOrientation" method on MPMoviePlayerViewController class to launch and play in landscape format. It looks like this:
- (bool) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation {// Return leaning back supported Yes (interfaceOrientation == UIInterfaceOrientationPortrait) ; } - (IBAction) Bakbutn {ChapterTableViewController * chapterTable = [self.storyboard instantiateViewControllerWithIdentifier: @ "Adyaytebl"]; [Self. Navigation Controller Current Model View Controller: Animated Animated Animation: Yes]; } - (IBAction) playVideo {NSURL * url = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource: @ "One Piece Episode 180" ofType: @ "mp4"]]; MPMoviePlayerViewController * playercontroller = [[MP Mpivipleyr Drishykantrolr alloc] initWithContentURL: url]; [Self current movieplayer visual controller: unmanned: play controller]; Playercontroller.moviePlayer.movieSourceType = MPMV SourceTypefile; [Plenty Controller. Play Movie Player]; Playercontroller = Zero; } @end
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO ]; [[View Yourself] Setbound: CGRactMake (0, 0, 480, 320)]; [[View Yourself] Setcenter: CG Point Make (160, 240)]; [[See itself] Set Transform: CGPhen Transcnet Mechotation (MOPI / 2)];
[yourInstanceOfMPMoviePlayerViewController shouldAutorotateToInterfaceOrientation: UIInterfaceOrientationLandscapeRight];
Comments
Post a Comment