以下代码在Webview中加载Vimeo vide,但用户必须单击该播放 按钮开始
VidViewController *webScrollView =
[[VidViewController alloc] initWithNibName:@"VidViewController" bundle:nil];
NSURL *url = [NSURL URLWithString:@"http://player.vimeo.com/video/36120576"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
webScrollView.request = request;
[self.navigationController pushViewController:webScrollView animated:YES];
[webScrollView release];
我想让MPMoviePlayerController工作,但无法加载视频。
- (void)viewDidLoad
{
[super viewDidLoad];
NSURL *audioURL = [NSURL URLWithString:@"http://player.vimeo.com/video/36120576"];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc]
initWithContentURL:audioURL];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player play];
}
- (void) movieFinishedCallback:(NSNotification*) aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player autorelease];
}
对developer.apple
的支持不多