serezhka / java-airplay-server

Acts like Apple TV
MIT License
327 stars 47 forks source link
airplay airplay-receiver airplay-server airplay2 airplaymirror appletv mirroring

java-airplay-server

build Release ViewCount License




14.12.2022: Check out new java-airplay project: https://github.com/serezhka/java-airplay


This is example of java-airplay-lib usage.

It's under development.

How to use?

AirplayDataConsumer dumper = new AirplayDataConsumer() {

@Override
public void onVideo(byte[] video) {
    videoFileChannel.write(ByteBuffer.wrap(video));
}

@Override
public void onAudio(byte[] audio) {
    if (FdkAacLib.isInitialized()) {
        byte[] audioDecoded = new byte[480 * 4];
        FdkAacLib.decodeFrame(audio, audioDecoded);
        audioFileChannel.write(ByteBuffer.wrap(audioDecoded));
    }
}

};

String serverName = "AirPlayServer"; int airPlayPort = 15614; int airTunesPort = 5001; new AirPlayServer(serverName, airPlayPort, airTunesPort, dumper).start();



## More examples

see repo [java-airplay-server-examples](https://github.com/serezhka/java-airplay-server-examples)

<img src="https://github.com/serezhka/java-airplay-server-examples/blob/media/gstreamer_playback.gif" width="600">