iPhone デバイスのサーバーからビデオを再生しようとしています。そのために次の方法を使用していますが、シミュレータでのみ機能します。iPhone 3G では動作しませんか?
iPhone 3G でこのメソッドを呼び出すと、ビデオ モーダル画面が開き、ビデオの読み込みが開始され、モーダル画面が突然閉じられます。コンソールにエラーは表示されません。
iPhone 3G にはバージョン 4.0 がインストールされています。私の iPhone 4 のバージョンは 4.1 です。
他の誰かがこれを経験しましたか?
-(IBAction)playMedia{
NSString* url = [self.data objectForKey:@"url"];
//initialize the movie player
self.moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:url]];
//show a background image while the user waits
moviePlayerViewController.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"background.png"]];
moviePlayerViewController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
//show the movie
[self presentMoviePlayerViewControllerAnimated:moviePlayerViewController];
[moviePlayerViewController release];
}