MPMoviePlayerController再次向后缓冲视频

时间:2016-02-17 05:21:35

标签: ios video mpmovieplayercontroller

我正在使用MPMoviePlayerController来播放来自server.it的视频工作正常,没问题。现在我播放缓冲视频然后再往后开始再次缓冲。这是一个编码问题或任何其他。任何帮助或建议将不胜感激

1 个答案:

答案 0 :(得分:2)

尝试以下代码

#import <MediaPlayer/MediaPlayer.h>
@property (strong, nonatomic) MPMoviePlayerController *streamPlayer;

 NSURL *streamURL = [NSURL URLWithString:@"http://clips.vorwaerts-gmbh.de/VfE_html5.mp4"];

    _streamPlayer = [[MPMoviePlayerController alloc] initWithContentURL:streamURL];

    // depending on your implementation your view may not have it's bounds set here
    // in that case consider calling the following 4 msgs later
    //http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
    [self.streamPlayer.view setFrame: self.view.bounds];

    self.streamPlayer.controlStyle = MPMovieControlStyleDefault;

    [self.view addSubview: self.streamPlayer.view];

    [self.streamPlayer play];