Expose AirPlay routes in AVFoundation
| Originator: | zach | ||
| Number: | rdar://12021052 | Date Originated: | 02-Aug-2012 04:09 PM |
| Status: | Open | Resolved: | |
| Product: | iPad SDK | Product Version: | |
| Classification: | Enhancement | Reproducible: | N/A |
02-Aug-2012 04:09 PM Zach Drayer:
When dealing with audio/video, AirPlay is basically a must-have feature at this point. However, the only way to have an AirPlay route picker is by using MPVolumeView from MediaPlayer.framework. In cases where one writes a custom player (for whatever reason one has -- why one would do this isn't the purpose of this radar), MediaPlayer.framework *still* needs to be linked in, in order to show the a/v route picker.
It would be nice if there was a property, perhaps on AVPlayer, that exposed available routes. This would be very preferable to having to link in MoviePlayer.framework for one bit of functionality that does not have a very complex UI.
In my mind, the ideal interface will look something like this:
extern NSString *const AVRouteAvailabilityDidChangeNotification;
@interface AVPlayer (Routing)
@property (atomic, retain) AVRoute *activeRoute;
@property (readonly) NSArray *routes;
@end
typedef enum {
AVRouteTypeLocalDevice,
AVRouteTypeAppleTV,
AVRouteTypeBluetooth,
AVRouteTypeWifi
} AVRouteType;
@interface AVRoute : NSObject
@property (readonly) NSString *displayName; // localized as needed
@property (readonly) UIImage *displayIcon; // suggested icon, to avoid confusing con
@property (readonly) AVRouteType routeType;
@property (readonly) BOOL active; // is the route currently in use?
@property (readonly) BOOL available; // is the route available, or has it disappeared on us?
@end
However! I would also be okay (even if not exactly happy with) with an interface along the lines of:
@interface AVPlayer (Routing)
@property (readonly) BOOL hasAvailableRoutes;
@end
// instantiate this view and stick it in your view hierarchy, like you would with a MPVolumeView.
@interface AVRoutePickerView : UIView
@end
02-Aug-2012 04:46 PM Zach Drayer:
"to avoid confusing con" -> "to avoid confusing consumers"
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!