Open-source AirPlay server in Java — receive audio, screen mirroring, and HLS video, and cast a local stream to other AirPlay devices.
- AirPlay audio and screen mirroring (FairPlay decrypt)
- HLS video playback
- Volume control
- Two native playback backends: GStreamer and FFmpeg (
ffplay) - Optional session dump (protocol + decrypted media) for debugging
- System tray with cast picker (discover LAN receivers and send a stream)
- Cast synthetic test A/V (
client.video.src=videotest,client.audio.src=audiotest) to another AirPlay receiver from the tray menu — useful for end-to-end send-path checks without a camera or screen capture. AAC audiotest is sent on the legacy FairPlay path; HAP/DataStream sessions are video-only today
git clone https://github.com/serezhka/java-airplay.git
cd java-airplay
./gradlew :app:gstreamer:bootRunFFmpeg backend: ./gradlew :app:ffmpeg:bootRun.
./gradlew bootJar builds both fat jars.
Download the latest release, then run one backend:
java -jar java-airplay-gstreamer-{version}.jar
java -jar java-airplay-ffmpeg-{version}.jarOn the phone, tablet, or Mac, open Screen Mirroring (or AirPlay from a video app)
and pick the advertised name (default: JavaAirPlay).
Each fat jar ships its own application.properties (app/gstreamer, app/ffmpeg).
Override by placing application.properties in the working directory:
# Receiver
airplay.server-name=JavaAirPlay
airplay.width=1920
airplay.height=1080
airplay.fps=60
airplay.hls-enabled=true
airplay.mdns-loopback=false
airplay.tray-enabled=true
# Cast sender: videotest|screencapture|none / audiotest|none
client.video.src=videotest
client.audio.src=audiotest
# Dump (optional receive-side sidecar)
dump.enabled=false
dump.directory=dumps
dump.protocol=true
dump.video=true
dump.audio=true
dump.playlist=true
dump.artwork=true
dump.videoFps=60GStreamer and FFmpeg are separate apps. Install the native stack that matches the jar
or bootRun task you start.
Install: GStreamer documentation · Downloads
On Windows 11 with Smart App Control enabled, HLS may fail to decode: the official
GStreamer runtime ships unsigned plugin DLLs, and SAC blocks them when Java loads them.
There is no per-app allowlist. Mirroring may still work if those plugins are already
trusted; for HLS on Windows use the FFmpeg backend, turn SAC off or disable hls with airplay.hls-enabled=false
Uses ffplay on PATH.
Install: FFmpeg download
Set dump.enabled=true to record beside the live player under
dumps/<timestamp>_<sessionId>/:
protocol/— RTSP/HTTP capturesmedia/— decrypted.h264/ remuxed.mp4, audio.caf/.aacextras/— HLS playlists, artwork, DMAP metadata when present
This monorepo unites the former: