Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/serezhka/java-airplay-server
Acts like Apple TV
https://github.com/serezhka/java-airplay-server
airplay airplay-receiver airplay-server airplay2 airplaymirror appletv mirroring
Last synced: 4 months ago
JSON representation
Acts like Apple TV
- Host: GitHub
- URL: https://github.com/serezhka/java-airplay-server
- Owner: serezhka
- License: mit
- Created: 2020-01-15T13:32:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-14T12:15:45.000Z (almost 2 years ago)
- Last Synced: 2024-07-27T17:58:43.283Z (4 months ago)
- Topics: airplay, airplay-receiver, airplay-server, airplay2, airplaymirror, appletv, mirroring
- Language: Java
- Homepage:
- Size: 33.9 MB
- Stars: 322
- Watchers: 32
- Forks: 46
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# java-airplay-server
[![build](https://github.com/serezhka/java-airplay-server/actions/workflows/build.yaml/badge.svg)](https://github.com/serezhka/java-airplay-server/actions/workflows/build.yaml)
[![Release](https://jitpack.io/v/serezhka/java-airplay-server.svg)](https://jitpack.io/#serezhka/java-airplay-server)
![ViewCount](https://views.whatilearened.today/views/github/serezhka/java-airplay-server.svg)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)####
14.12.2022: Check out new java-airplay project: https://github.com/serezhka/java-airplayThis is example of [java-airplay-lib](https://github.com/serezhka/java-airplay-lib) usage.
It's under development.
## How to use?
* Add java-airplay-server [dependency](https://jitpack.io/#serezhka/java-airplay-server) to your project
* Implement AirplayDataConsumer and start AirPlayServer, for example:
```java
FileChannel videoFileChannel = FileChannel.open(Paths.get("video.h264"), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);
FileChannel audioFileChannel = FileChannel.open(Paths.get("audio.pcm"), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE);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)