如何在iPad上打开quicktime播放器
我正在编写一个iPad应用程序。在此应用程序中,我想在默认Quicktime player中打开电影URL。当我试图在浏览器中打开URL时,电影开始在浏览器中播放。如何在默认播放器中打开电影,以便获得播放暂停控制 任何帮助都将不胜感激 谢谢如何在iPad上打开quicktime播放器,ipad,Ipad,我正在编写一个iPad应用程序。在此应用程序中,我想在默认Quicktime player中打开电影URL。当我试图在浏览器中打开URL时,电影开始在浏览器中播放。如何在默认播放器中打开电影,以便获得播放暂停控制 任何帮助都将不胜感激 谢谢 Saurabh最后,我认为在iPad上打开quicktime播放器是不可能的。所以我在谷歌上搜索,找到了mpmovieplayervewcontroller类,它很好地解决了我的问题 - (void)viewDidLoad { NSString *u
Saurabh最后,我认为在iPad上打开quicktime播放器是不可能的。所以我在谷歌上搜索,找到了mpmovieplayervewcontroller类,它很好地解决了我的问题
- (void)viewDidLoad {
NSString *url = [[NSBundle mainBundle]
pathForResource:@"Stock_Footage_Demobroadband"
ofType:@"mp4"];
MPMoviePlayerViewController *playerViewController =
[[MPMoviePlayerViewController alloc]
initWithContentURL:[NSURL fileURLWithPath:url]];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(movieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:[playerViewController moviePlayer]];
[self.view addSubview:playerViewController.view];
//---play movie---
MPMoviePlayerController *player = [playerViewController moviePlayer];
[player play];
[super viewDidLoad]; }
- (void) movieFinishedCallback:(NSNotification*) aNotification {
MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player];
[player stop];
[self.view removeFromSuperView];
[player autorelease]; }
我已经在我的博客上发布了完整的教程