【发布时间】:2016-02-17 05:21:34
【问题描述】:
我正在使用 MPMoviePlayerController 从服务器播放视频。它工作正常,没问题。现在,一旦我播放缓冲视频,然后向后播放,它就会再次开始缓冲。这是编码问题还是任何其他问题。任何帮助或建议将不胜感激
【问题讨论】:
标签: ios video mpmovieplayercontroller
我正在使用 MPMoviePlayerController 从服务器播放视频。它工作正常,没问题。现在,一旦我播放缓冲视频,然后向后播放,它就会再次开始缓冲。这是编码问题还是任何其他问题。任何帮助或建议将不胜感激
【问题讨论】:
标签: ios video mpmovieplayercontroller
试试下面的代码
#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];
【讨论】: