Removing/Deactivating fullscreen button on MoviePlayerControl

荒凉一梦 提交于 2019-12-13 04:24:24

问题


is there a way to remove the fullscreen button from MPMoviePlayerController? Or at least deactivate it?

Yes I searched, but the older question isn't solved and I don't know if there is something like a "push" feature.


回答1:


There is no way to do that. You can hide the entire control panel. Hopefully this link helps.




回答2:


Actually there is no way to achieve this.

You can use either:

[yourPlayer setMovieControlMode:MPMovieControlModeNone];

(But it'll hide all controls)

or

Disable the user interaction using:

yourPlayer.view.userInteractionEnabled = NO;

(But no controls can be used)




回答3:


Try this one it worked for me

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


来源:https://stackoverflow.com/questions/16786652/removing-deactivating-fullscreen-button-on-movieplayercontrol

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!