1

I am building a macOS app in Objective C based on Apple's demo app AVMovieEditor. I do not want the player controls and timeline to ever hide. The default behavior is for it to show only when the mouse has recently been moving over the player, otherwise it auto hides. See the picture with the player controls at the bottom not hidden.

AVPlayer with player controls showing

I have searched for an way to control this, but I am not entirely sure what apple calls this overlay. AVPlayerController has a property showsPlaybackControls, but it is only a boolean that can instruct the player to NEVER show controls. It's default is YES ( meaning show controls ). I am looking for an ALWAYS show option.

I imagine this would be done here in my code: ( From Apple's AAPLDocument.m )

- (void)makeWindowControllers {
    NSStoryboard *storyboard = [NSStoryboard storyboardWithName:@"Main" bundle:nil];
     NSWindowController* windowController = [storyboard instantiateControllerWithIdentifier:@"Document Window Controller"];
    [self addWindowController:windowController];
    self.movieViewController = (AAPLMovieViewController *)windowController.contentViewController;
    self.movieViewController.delegate = self;
    self.movieViewController.playerView.player = [AVPlayer playerWithPlayerItem:[self.movieMutator makePlayerItem]];
    // I want something like: 
    // self.movieViewController.playerView.playerControlsAutoHide = NO;
    ...
}
markjwill
  • 206
  • 5
  • 15
  • Some options to consider: Private API, simulate mouse events, or create your own controls that control the AVPlayer directly. – Lucas Derraugh Dec 15 '16 at 06:44
  • Thanks, I will consider those options... But, does your suggestion imply that you are certain there is no existing code lever to pull to accomplish my desire from the AVPlayer code that apple offers? – markjwill Dec 15 '16 at 15:29
  • I am not certain that public API doesn't exist. – Lucas Derraugh Dec 15 '16 at 15:50
  • @markjwill, have you find the way to always show the playback controls? I need to show the controls always. Any guidance will be appreciated. – pkc456 Oct 03 '17 at 14:04
  • @pkc456 sorry, I don't recall the answer and I don't work for the company that I was writing this code for anymore. – markjwill Oct 03 '17 at 19:44
  • is iOS you can set that by KVC, not sure about macOS see my answer: https://stackoverflow.com/a/54390333/1290278 – Amir Khorsandi Jan 27 '19 at 16:36

0 Answers0