MPMoviePlayerController doesn't provide any way to dismiss video if it is playin

Originator:jmacmullin
Number:rdar://11325295 Date Originated:26-Apr-2012 08:16 PM
Status:Open Resolved:
Product:iPhone SDK Product Version:5.1
Classification:Serious Bug Reproducible:Always
 
MPMoviePlayerController doesn't provide any way to dismiss video if it is playing an audio-only stream

Summary:
An MPMoviePlayerController whose view has been added to my view controller's view and whose controlStyle has been set to MPMovieControlStyleFullscreen normally shows a toolbar with a 'done' button that allows me to dismiss the movie player whilst it is playing a video. However if the video being played is a HTTP Live Streaming video and the movie player has switched to an audio-only stream, the toolbar and 'done' button are no longer shown and there is no way to dismiss the video.

Steps to Reproduce:
Create a UIViewController subclass that initialises an MPMoviePlayerController, sets its controlStyle to MPMovieControlStyleFullscreen and adds the movie player's view to its view. Start playing a HTTP Live Streaming video that includes an audio-only stream. Use Network Link Conditioner to simulate a slow connection so the movie player switches to the audio-only stream.

Expected Results:
There is some way to dimsiss the video player (either by continuing to show the toolbar and 'done' button that is shown when playing one of the video streams or by providing a notification to my view controller so I can add a toolbar).

Actual Results:
The playback controls change to a single black bar in the middle of the view with a play/pause button and no toolbar or 'done' button to dismiss the player (see attached sample project and screen shot).

Regression:
This doesn't seem to be a problem with MPMoviePlayerViewController (but I don't wish to use this class as my view controller displays other content before video playback starts).

Comments

Work-around

This is a confirmed bug.

A work-around is to subscribe to notifications when the movie player switches between streams and add a extra toolbar and done button if it switches to an audio-only stream, removing it if it switches back to a stream that contains video.

   // subscribe for notifications when the mpmovieplayercontroller switches between different bit-rate streams
           [[NSNotificationCenter defaultCenter] addObserver:self
                                                    selector:@selector(mediaTypesAvailable:)
                                                        name:MPMovieMediaTypesAvailableNotification
                                                      object:nil];

  • (void)mediaTypesAvailable:(id)info { if ([self.moviePlayer movieMediaTypes] & MPMovieMediaTypeMaskVideo) { // video is available, remove the 'extra' toolbar } else { // there's no video in this stream, add a toolbar with a done button } }
By jmacmullin at May 3, 2012, 9:52 a.m. (reply...)

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!