This is example of java-airplay-lib usage.
It's under development.
-
Add java-airplay-server dependency to your project
-
Implement MirrorDataConsumer and start AirPlayServer, for example:
String dumpName = "dump.h264";
var fileChannel = FileChannel.open(Paths.get(dumpName), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);
MirrorDataConsumer h264Dump = data -> {
try {
fileChannel.write(ByteBuffer.wrap(data));
} catch (IOException e) {
e.printStackTrace();
}
};
String serverName = "AirPlayServer";
int airPlayPort = 15614;
int airTunesPort = 5001;
new AirPlayServer(serverName, airPlayPort, airTunesPort, h264Dump).start();
see repo java-airplay-server-examples