我正在使用以下代码尝试在我的iPhone应用中播放视频。但是,我不明白为什么它不起作用。
NSURL *url = [NSURL fileURLWithPath:filePath];
MPMoviePlayerController* moviePlayer = [[[MPMoviePlayerController alloc] initWithContentURL:url] autorelease];
moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;
[self.view addSubview:moviePlayer.view];
[moviePlayer setFullscreen:YES animated:YES];
答案 0 :(得分:1)
你的播放声明在哪里?
[moviePlayer play];