0
在我的ViewController我放置MPMoviePlayerController
播放视频。它工作正常。它也能够以全屏模式播放。现在,我需要在风景权和播放这部电影景观左也。我如何实现这一目标?而且,重要的注意事项是我的应用程序仅支持肖像模式。我只想在两个方向上显示这个电影播放器。我怎么做?任何想法可观!MPMoviePlayer在多个方向
这里是我的代码 -
-(void)playMovie
{
NSString *movieURL = ___;
NSURL *url = [NSURL URLWithString:movieURL];
player = [[MPMoviePlayerController alloc]initWithContentURL:url];
self._moviePlayer = player;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:_moviePlayer];
_moviePlayer.controlStyle = MPMovieControlStyleDefault;
_moviePlayer.shouldAutoplay = YES;
_moviePlayer.view.frame = CGRectMake(10, shortDesc.frame.origin.y+shortDesc.frame.size.height+10, 280,150);
[_moviePlayer play];
}
- (void) moviePlayBackDidFinish:(NSNotification*)notification
{
player = [notification object];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:player];
if ([player respondsToSelector:@selector(setFullscreen:animated:)]) {
}
}