Next/Previous buttons on iPhone MPMoviePlayerController

后端 未结 3 1619
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 13:46

When using the MPMoviePlayerController, the play button is surrounded with \"Next\" and \"Previous\" buttons.

How do I get notifications when they are clicked? is t

3条回答
  •  臣服心动
    2020-12-31 14:21

    No notifications are generated when the user presses the next/previous buttons (you should file a bug about that), so the only way to solve this without any unapproved view-crawling is to implement your own video overlay view:

    MPMoviePlayerController* moviePlayer = [[MPMoviePlayerController alloc]
        initWithContentURL:someUrl];
    moviePlayer.movieControlMode = MPMovieControlModeHidden;
    [moviePlayer play];
    
    NSArray* windows = [[UIApplication sharedApplication] windows];
    if ([windows count] > 1) {
      UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow];
      [moviePlayerWindow addSubview:yourCustomOverlayView];
    }
    

    Not ideal, but the standard controls are quite easy to re-implement.

提交回复
热议问题