MPMovieplayercontroller 在流式传输时自动暂停并且不再播放
MPMovieplayercontroller automatically pauses while streaming and doesn't play again
我正在使用 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];
流式传输时暂停,不会自动播放。我必须手动播放。但是,流式传输完成后应该会自动开始播放。
您应该按以下说明来源类型:
mPlayerVC.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
我正在使用 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];
流式传输时暂停,不会自动播放。我必须手动播放。但是,流式传输完成后应该会自动开始播放。
您应该按以下说明来源类型:
mPlayerVC.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;