如何判断AirPlay是否为镜像?
问题描述:
我正在研究具有AirPlay功能的视频内容应用程序。当它通过AirPlay(AVPlayer)流式传输视频内容时,设备上的用户界面将成为播放器的遥控器,但是当AirPlay设置为镜像时,它会在预期的两台设备上显示相同的界面,因为所有I知道AirPlay已连接,但我不知道它是否是镜像。我使用下面的代码来检查AirPlay连接:如何判断AirPlay是否为镜像?
- (BOOL)isAirPlayTVOutput {
return ([self isAirplayActive] && ![self isBluetoothOutputType]);
}
- (BOOL)isAirplayActive {
self.deviceOutputType = nil;
self.airplayDeviceName = nil;
AVAudioSessionRouteDescription *routeDescription = [[AVAudioSession sharedInstance] currentRoute];
for (AVAudioSessionPortDescription *portDescription in routeDescription.outputs) {
self.deviceOutputType = portDescription.portType;
self.airplayDeviceName = portDescription.portName;
if ([portDescription.portType isEqualToString:AVAudioSessionPortAirPlay]) {
return YES;
}
}
return NO;
}
我怎么知道它是否是镜像?
您好兄弟在这如何区分连接的是蓝牙还是Airplay设备? – Yohan