I have an iOS app which I am developing, this app has videos which are copyright material. I am allowed to use them to be seen within the app but not to be seen when connected to a TV. ie. via HDMI or component - instead when a video is playing and someone connects a tv out lead to the device i need to display a screen like a splash screen saying it is not allowed etc...
So my question is how can i catch when a tv out device has been connected to the device? or how can i know when tv out has been requested to the MPMoviePlayerController (which is what im using 开发者_StackOverflow社区to display the video)?
I have searched everywhere for this and can not find any answer!
Thanks.
Check out Technical Q&A QA1738: How to Opt Out of Video Mirroring. Here is what you basically need to do:
UIScreen *aScreen;
NSArray *screens = [UIScreen screens];
for (aScreen in screens)
{
if ([aScreen respondsToSelector:@selector(mirroredScreen)]
&& [aScreen mirroredScreen] == [UIScreen mainScreen])
{
// The main screen is being mirrored.
}
else
{
// The main screen is not being mirrored, or
// you are not running on a compatible device.
}
}
精彩评论