1
我該怎麼做?我不能只將userInteraction設置爲NO,因爲我仍然需要用戶能夠通過捏放/縮放來調整視頻大小。我只是不希望玩家進入全屏模式。iOS - 禁用MPMoviePlayerController全屏的雙指縮放
我該怎麼做?我不能只將userInteraction設置爲NO,因爲我仍然需要用戶能夠通過捏放/縮放來調整視頻大小。我只是不希望玩家進入全屏模式。iOS - 禁用MPMoviePlayerController全屏的雙指縮放
希望這有助於!
- (void)viewDidLoad {
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieEventFullscreenHandler:)
name:MPMoviePlayerWillEnterFullscreenNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieEventFullscreenHandler:)
name:MPMoviePlayerDidEnterFullscreenNotification
object:nil];
self.moviePlayer.controlStyle = MPMovieControlStyleEmbedded;
}
- (void)movieEventFullscreenHandler:(NSNotification*)notification {
[self.moviePlayer setFullscreen:NO animated:NO];
[self.moviePlayer setControlStyle:MPMovieControlStyleEmbedded];
}
這絕對會使它恢復爲「非全屏」模式。仍然希望有一種方法可以防止首先進入全屏模式。 – soleil 2012-07-16 23:34:50
你可以隨時拋出某種UIView(加載屏幕或其他東西),然後在調用-movieEventFullScreenHandler後移除。這種做法很冒險。 – random 2012-07-23 20:05:47