Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在iPad上打开quicktime播放器_Ipad - Fatal编程技术网

如何在iPad上打开quicktime播放器

如何在iPad上打开quicktime播放器,ipad,Ipad,我正在编写一个iPad应用程序。在此应用程序中,我想在默认Quicktime player中打开电影URL。当我试图在浏览器中打开URL时,电影开始在浏览器中播放。如何在默认播放器中打开电影,以便获得播放暂停控制 任何帮助都将不胜感激 谢谢 Saurabh最后,我认为在iPad上打开quicktime播放器是不可能的。所以我在谷歌上搜索,找到了mpmovieplayervewcontroller类,它很好地解决了我的问题 - (void)viewDidLoad { NSString *u

我正在编写一个iPad应用程序。在此应用程序中,我想在默认Quicktime player中打开电影URL。当我试图在浏览器中打开URL时,电影开始在浏览器中播放。如何在默认播放器中打开电影,以便获得播放暂停控制

任何帮助都将不胜感激

谢谢
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]; }
我已经在我的博客上发布了完整的教程