MPMoviePlayerController changing controlStyle causes unexpected notifications

Originator:evan
Number:rdar://10607169 Date Originated:20-Dec-2011 10:39 AM
Status:Open Resolved:
Product: Product Version:
Classification: Reproducible:
 
Summary:
Changing the @property (nonatomic) MPMovieControlStyle controlStyle of a MPMoviePlayerController produces unexpected notifications to post. Specifically it will post notifications that are in direct conflict with the class reference documentation.

Steps to Reproduce:
1. alloc & init a MPMoviePlayerController with a valid local or stream movie URL & prepare for playback
2. Change the controlStyle property to MPMovieControlStyleNone
3. Register for the following notifications:
- MPMoviePlayerWillEnterFullscreenNotification
- MPMoviePlayerWillExitFullscreenNotification
- MPMoviePlayerDidEnterFullscreenNotification
- MPMoviePlayerDidExitFullscreenNotification
- MPMoviePlayerPlaybackDidFinishNotification
4. Wire up a UIButton to call setFullscreen:animated: on the movie player controller
5. From within MPMoviePlayerWillEnterFullscreenNotification selector, set controlStyle property to MPMovieControlStyleFullscreen
6. Run app, trigger full screen, tap "Done"
7. MPMoviePlayerPlaybackDidFinishNotification is posted, NOT MPMoviePlayer[Will / Did]ExitFullScreenNotifications

Expected Results:
According to class reference documentation:
"... This notification is not sent in cases where the movie player is displaying in fullscreen mode and the user taps the Done button. In that instance, the Done button causes movie playback to pause while the player transitions out of fullscreen mode. If you want to detect this scenario in your code, you should monitor other notifications such as MPMoviePlayerDidExitFullscreenNotification."

Actual Results:
What actually happens is that MPMoviePlayerPlaybackDidFinishNotification is posted with MPMoviePlayerPlaybackDidFinishReasonUserInfoKey set to MPMovieFinishReasonUserExited.

Furthermore, any attempt at calling setFullscreen:NO animated:* results is no change of the MPMoviePlayerController.view frame, bounds, or center.

If you don't unregister from MPMoviePlayerPlaybackDidFinishNotification and call setFullscreen:NO animated:* from within the selector registered to fire for ....PlaybackDidFinishNotification you'll get infinitely recursive calls to the registered selector.

Regression:

If you do not modify the controlStyle property, everything works as documented. It's only when you modify the controlStyle property as you enter / exit fullscreen.

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!