我正在使用MPMoviePlayerController
来播放URL
的视频。以下是我的代码:
NSString* url = [[promotionalDetailResponse objectAtIndex:index] valueForKey:@"Url"];
NSURL *streamURL = [NSURL URLWithString:url];
mPlayerVC = [[MPMoviePlayerViewController alloc] initWithContentURL:streamURL];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackComplete:)
name:MPMoviePlayerWillExitFullscreenNotification
object:nil];
mPlayerVC.moviePlayer.fullscreen=YES;
mPlayerVC.moviePlayer.shouldAutoplay=YES;
[self presentMoviePlayerViewControllerAnimated:mPlayerVC];
流式传输时暂停,不会自动播放。我必须手动播放。但是,一旦完成流式传输,它应该会自动开始播放。
答案 0 :(得分:1)
您应该提及源类型如下:
{{1}}