如何在ViewController中仅自动旋转MPMoviePlayerController?

时间:2013-07-13 17:22:02

标签: rotation mpmovieplayercontroller autorotate mpmovieplayer

我尝试了很多解决方案,但尚未奏效!我正在Xcode 4.6.3上开发iOS 6.1 iPhone应用程序。

我在我的应用程序中使用MPMoviePlayerController。我有4个标签应用程序。 Movieplayer在SecondViewController中。我不是将它作为视图控制器呈现,而是将其视图添加到我自己的视图控制器中。视频播放得很好,我可以全屏播放。

以下是我的代码。任何解决方案?

#import "SecondViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

@synthesize moviePlayer;

- (IBAction)playVideo:(id)sender {

    NSURL * url = [[NSURL alloc]initWithString:@"http://server:1935/live/test/playlist.m3u8"];

    moviePlayer = [[MPMoviePlayerController alloc]initWithContentURL:url];

    [self.view addSubview:moviePlayer.view];

    moviePlayer.fullscreen = YES;
    moviePlayer.allowsAirPlay = YES;

    }

@end

0 个答案:

没有答案