MPVolumeView as AirPlay indicator on iPad

Originator:david.anderson
Number:rdar://14304237 Date Originated:28-Jun-2013 11:08 AM
Status:Open Resolved:
Product:iOS SDK Product Version:6.1
Classification:UI/Usability Reproducible:Always
 
Summary:

Using an MPVolumeView as an indicator of AirPlay availability (and to select the AirPlay endpoint) suffers from the deficiency of ALWAYS using the iPhone-sized art.  Thus when building an AVFoundation-based video player and including an iPhone-size UI as well as an iPad-sized UI, the AirPlay selector on iPhone is a correct size, but on iPad (with slightly larger video controls) the AirPlay selector *only* shows up in an iPhone size and therefore is disproportionally small compared to the rest of the UI.  (This assumes a custom AVFoundation player with video controls size to match the iPad MPMoviePlayerController player control sizes.)

That is, it is not possible to fully replicate the UI of MPMoviePlayerController on iPad because the MPVolumeView, configured as an AirPlay selector, only ever shows up using the iPhone artwork.  (UIKit-Artwork-Extractor confirms that there is iPad-specific AirPlay artwork, but MPVolumeView cannot be configured to use it.)

Steps to Reproduce:

Place MPVolumeView configured as an AirPlay selector in an iPad UI.  Note the size difference between the MPVolumeView vs the AirPlay selector in MPMoviePlayerController.

Expected Results:

That MPVolumeView automatically recognizes that it is on an iPad and uses the iPad-size art (matching MPMoviewPlayerController)

Actual Results:

MPVolumeView only ever displays the iPhone-sized art.

Regression:

Notes:

Comments

This is already supported. Use -[MPVolumeView setRouteButtonImte:forState:] to do this on iOS 6+.

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { if ([_airplayView respondsToSelector:@selector(setRouteButtonImage:forState:)]) { // iOS 6 [_airplayView setRouteButtonImage:[UIImage imageNamed:@"fullscreen-airplay_normal"] forState:UIControlStateNormal]; [_airplayView setRouteButtonImage:[UIImage imageNamed:@"fullscreen-airplay_selected"] forState:UIControlStateSelected]; } }

On iOS 5 it's more difficult but possible. This works: http://stackoverflow.com/questions/12318377/how-to-customize-the-airplay-button-when-airplay-is-active


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!