我们正在开发一款iOS应用程序,用户可以在订阅模式下观看视频。我们不希望用户将视频Airplay到任何其他设备。视频是在UIWebView中播放的。我查看了各种在线资源:
if ([[UIScreen screens] count] < 2)) {
//streaming
}
else {
//mirroring
}
我也尝试了这段代码:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveAirPlayNotification:) name: UIScreenDidConnectNotification object:nil];
当我启动应用程序并打开Airplay时,此通知系统才能正常工作。如果我先打开Airplay,然后再启动应用程序,则无法检测到任何内容。
我需要在应用程序启动时检测是否已启用镜像。我已经看到其他应用程序可以做到这一点,因此我相信这是可能的。
请帮忙。