7月 12, 2010
覚え書き。
メディアプレーヤーを作成して、動画を再生します。
MPMoviePlayerControllerを使用します。
#import <MediaPlayer/MediaPlayer.h>
した上で、
// 動画URL NSString *movieURL = @"[URL]"; NSURL *url = [NSURL URLWithString:movieURL]; // プレーヤーを生成 MPMoviePlayerController *player = [[MPMoviePlayerController alloc] init]; [player setContentURL:url]; // プレーヤーを再生 [player play];
これが再生までの流れです。
ネットワークを考慮した処理などが抜けているので実際には必要です。
Notificationsを利用して、データ取得後、再生後等の通知を設定します。
メディアプレーヤーの生成 | iPad Techfirm Lab
http://bit.ly/bGNQNN
This comment was originally posted on Twitter