iOS - 禁用MPMoviePlayerController全屏幕的双指缩放

时间:2012-07-16 17:56:37

标签: ios video mpmovieplayercontroller gesture-recognition

我该怎么做?我不能只将userInteraction设置为NO,因为我仍然需要用户能够通过捏合/缩放来调整视频大小。我只是不希望播放器进入全屏模式。

1 个答案:

答案 0 :(得分:0)

希望这会有所帮助!!

  - (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];
    }