I have a MPMoviewPlayerViewController
embedded into an UIView
object. When I start the player in the embedded mode everything works fine and as expected. If the user then taps onto the fullscreen toggle (or if I change to fullscreen programmatically using setFullscreen:animated
) the player goes fullscreen, the movie plays for another second and after that the screen goes black with only a "Loading..." message.
This behavior only appears using iOS 6 (also iPad 6.0 Simulator), on devices running iOS 5 everything works as intended.
The movie source is a local file from the app bundle.
Upon playing & entering fullscreen the debug output is as follows:
2012-09-26 15:24:48.251 [39895:c07] [MPAVController] Autoplay: Disabling autoplay for pause 2012-09-26 15:24:48.252 [39895:c07] [MPAVController] Autoplay: Disabling autoplay 2012-09-26 15:24:48.262 [39895:c07] [MPAVController] Autoplay: Enabling autoplay 2012-09-26 15:24:48.265 [39895:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0 2012-09-26 15:24:48.266 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up. 2012-09-26 15:24:48.267 [39895:c07] [MPAVController] Autoplay: Likely to keep up or full buffer: 0 2012-09-26 15:24:48.268 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up. 2012-09-26 15:24:48.276 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1) 2012-09-26 15:24:48.286 [39895:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0 2012-09-26 15:24:48.938 [39895:c07] [MPAVController] Autoplay: Enabling autoplay 2012-09-26 15:24:48.940 [39895:c07] [MPAVController] Autoplay: Enabling autoplay 2012-09-26 15:24:48.954 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1) 2012-09-26 15:24:49.006 [39895:c07] [MPAVController] Autoplay: Enabling autoplay 2012-09-26 15:24:49.012 [39895:c07] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1)
Has somebody an idea why the player stops working?
Edit: Added an example project on github
I solved it by myself. As I add the Movie Player as a subview to a container view I don't need to use the actual view controller created with the MPMoviePlayerViewController
which is intended to be used to present it modally or in some other vc hierarchy.
For the single purpose of having a Movie Player view that can be added to some other view as a subview the MPMoviePlayerController
's view property is sufficient.
Until iOS 6 both worked but iOS 6 seems to differ in terms of ressource management/lifetime.
The example project is updated with working code.