Reputation: 3955
I am trying to enable airplay in my application using setAllowAirplay but its showing below warning.
MPMoviePlayerViewController may not respond to 'setAllowsAirPlay'
So please suggest how can I enable airplay in my application.
Upvotes: 0
Views: 526
Reputation: 722
The warning is there because not all iOS versions and devices include the allowsAirPlay property. The safe way to call it would be like this:
if ([moviePlayerVC.moviePlayer respondsToSelector:@selector(setAllowsAirPlay:)]) {
[moviePlayerVC.moviePlayer setAllowsAirPlay:YES];
}
I'm pretty sure that this selector will exist on any modern iOS device.
Upvotes: 2