iPad MPMoviePlayerController - Disable Fullscreen

后端 未结 16 2128
一向
一向 2020-12-06 01:38

Is there a way to disable the fullscreen button of the MPMoviePlayerController ?

16条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 02:06

    There's a cheat:

    MPMoviePlayerController *mpc = (...some instance...)
    UIView *fsbutton = [[mpc view] viewWithTag:512];
    [fsbutton setHidden:YES];
    

    The main catch is, you have to do it in viewDidAppear: or similar, because the MoviePlayer view sets itself up somewhere inside didMoveToWindow or didMoveToSuperview, which happen after viewWillAppear:. So you get a brief flash of the fullscreen button. Other obvious catches include: brittle vs. Apple changing that 512 tag value (although it works in 3.2 - 4.2); and of course Apple would rather you not do this.

    The endorsed solution is to set the control style to MPMovieControlStyleNone and roll your own transport controls, which is more work.

提交回复
热议问题