如何使用Mono.Zeroconf制作AirPlay接收器

时间:2015-10-27 08:11:33

标签: c# mono airplay zeroconf

我正试图在Windows上制作一个AirPlay接收器,我偶然发现了Mono.Zeroconf http://www.mono-project.com/archived/monozeroconf/。有了这个,我试着提出代码。以下是代码段:

编辑代码:

RegisterService airplayService = new RegisterService();
RegisterService raopService = new RegisterService();

TxtRecord airplayTxtRecord = new TxtRecord();
TxtRecord raopTxtRecord = new TxtRecord();

raopTxtRecord.Add("txtvers", "1");
raopTxtRecord.Add("ch", "2");
raopTxtRecord.Add("cn", "0,1,2,3");
raopTxtRecord.Add("da", "true");
raopTxtRecord.Add("et", "0,3,5");
raopTxtRecord.Add("md", "0,1,2");
raopTxtRecord.Add("pw", "false");
raopTxtRecord.Add("sv", "false");
raopTxtRecord.Add("sr", "44100");
raopTxtRecord.Add("ss", "16");
raopTxtRecord.Add("tp", "UDP");
raopTxtRecord.Add("vn", "65537");
raopTxtRecord.Add("vs", "130.14");
raopTxtRecord.Add("am", "AppleTV2,1");
raopTxtRecord.Add("sf", "0x4");

raopService.Name = macAddress + "@" + "AirPlay Receiver";
raopService.RegType = "_raop._tcp";
raopService.ReplyDomain = "local.";
raopService.UPort = 49152;
raopService.TxtRecord = raopTxtRecord;
raopService.Register();

airplayTxtRecord.Add("deviceid", macAddress);
airplayTxtRecord.Add("features", "0x39f7");
airplayTxtRecord.Add("model", "AppleTV2,1");
airplayTxtRecord.Add("srcvers", "130.14");

airplayService.Name = "AirPlay Receiver";
airplayService.RegType = "_airplay._tcp";
airplayService.ReplyDomain = "local.";
airplayService.Port = 7000;
airplayService.TxtRecord = airplayTxtRecord;
airplayService.Register();

我将此作为参考:https://nto.github.io/AirPlay.html#servicediscovery-airplayservice

现在我想知道如何将我的设备镜像到我的应用程序?

1 个答案:

答案 0 :(得分:0)

我从某些软件发现iOS 9,你需要将功能更改为0x5A7FFFF7。然后您的服务器将被识别为视频设备。