【问题标题】:MPMoviePlayerViewController continue play different videoMPMoviePlayerViewController 继续播放不同的视频
【发布时间】:2012-11-28 07:01:15
【问题描述】:

我有 3 个不同的视频:video1、video2、video3

我想当video1播放结束然后继续播放video2然后继续播放video3然后结束

这是我当前的代码:

moviePlayerViewController = [[MPMoviePlayerViewController alloc] init];
moviePlayerViewController.moviePlayer.contentURL = [NSURL URLWithString:video1];
[self.navigationController presentMoviePlayerViewControllerAnimated:moviePlayerViewController];

我想也许我应该使用

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(playbackFinishedCallback:)
                                             name:MPMoviePlayerLoadStateDidChangeNotification
                                           object:moviePlayerViewController.moviePlayer];

但是当 video1 播放完成时,navigationController 会关闭

我应该如何解决它,谢谢。

【问题讨论】:

    标签: ios mpmovieplayercontroller mpmovieplayer


    【解决方案1】:

    您可以使用AVQueuePlayer 对视频进行排队。

    【讨论】:

    • 我试过你的建议,没问题,但是MovieControlBar消失了,有什么办法可以显示吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多