1

私は多くの解決策を試しましたが、まだうまくいきません! Xcode 4.6.3でiOS 6.1 iPhoneアプリを開発しています。

アプリケーションで MPMoviePlayerController を使用しています。私は4つのタブ付きアプリケーションを持っています。Movieplayer は SecondViewController にあります。私はそれをView Controllerとして提示していませんが、そのビューを自分のView Controllerに追加しています。ビデオは問題なく再生され、全画面表示にできます。

以下は私のコードです。解決策はありますか?

#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
4

0 に答える 0