Anshul
Anshul

Reputation: 244

how to add custom functionality on click of Done button in MPMoviePlayerController

I want to add a custom functionality of mine, while we click the "Done" button displayed on top of the screen when the MPMoviePlayerController goes to full screen mode.

Any ideas on that?

Upvotes: 0

Views: 1227

Answers (1)

jbat100
jbat100

Reputation: 16827

You can register for the MPMoviePlayerPlaybackDidFinishNotification notification. This notification's userInfo property has an object for MPMoviePlayerPlaybackDidFinishReasonUserInfoKey, check that and see if it is MPMovieFinishReasonUserExited. If that's the case, your user has hit done and you can go ahead with your custom functionality. If you want to stop it from ending playback altogether, things might get more complicated.

You can also register for the MPMoviePlayerWillEnterFullscreenNotification notification or check the MPMoviePlayerController fullscreen property.

Upvotes: 2

Related Questions