代码拉取完成,页面将自动刷新
This library is intended to easily create AirPlay2 servers acting like Apple TV. Tested with iPhone X (iOS 14.0.1)
Add java-airplay-lib dependency to your project
Make your server discoverable by Bonjour
String serverName = "@srzhka";
int airPlayPort = 5001;
int airTunesPort = 7001;
AirPlayBonjour airPlayBonjour = new AirPlayBonjour(serverName);
airPlayBonjour.start(airPlayPort, airTunesPort);
...
airPlayBonjour.stop();
RTSP GET | POST
String uri = ...
byte[] requestContent = ...
switch (uri) {
case "/info": {
airPlay.info(.. byte output stream ..);
// RTSP OK + provided bytes
}
case "/pair-setup": {
airPlay.pairSetup(.. byte output stream ..);
// RTSP OK + provided bytes
}
case "/pair-verify": {
airPlay.pairVerify(.. requestContent input stream ..,
.. byte output stream ..);
// RTSP OK + provided bytes
}
case "/fp-setup": {
airPlay.fairPlaySetup(.. requestContent input stream ..,
.. byte output stream ..);
// RTSP OK + provided bytes
}
case "/feedback": {
// RTSP OK
}
}
RTSP SETUP
airPlay.rtspSetup(.. requestContent input stream ..,
.. byte output stream .., int videoDataPort, int videoEventPort,
int videoTimingPort, int audioDataPort, int audioControlPort);
// RTSP OK + provided bytes
if (airPlay.isFairPlayVideoDecryptorReady()) {
// start listening video data on videoDataPort
}
if (airPlay.isFairPlayAudioDecryptorReady()) {
// start listening audio data on audioDataPort
}
RTSP GET_PARAMETER, RECORD, SET_PARAMETER, TEARDOWN
...
DECRYPT MIRROR DATA
airPlay.decryptVideo(byte[] video);
airPlay.decryptAudio(byte[] audio, int audioLength);
java-airplay-server with Netty
Analysis of AirPlay2 Technology
Inspired by many other open source projects analyzing AirPlay2 protocol. Special thanks to OmgHax.c's author 🤯
It took me several months of sleepless nights with debugger and wireshark to make this work.
If you appreciate my work, consider buying me a cup of coffee to keep me recharged
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。