Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- AirPlay audio + screen mirroring
- FairPlay decryption for mirrored streams
- Volume control
- YouTube HLS playback (AirPlay video from the YouTube app)
- YouTube HLS playback (not stable, disabled by default `airplay.hls.enabled=false`)
- Playbacks: GStreamer, FFmpeg (`ffplay`)
- Optional session dump (protocol + decrypted media) for debugging

Expand Down Expand Up @@ -55,9 +55,10 @@ Create `application.properties` in the working directory:
```properties
# airplay
airplay.serverName=srzhka
airplay.width=1280
airplay.height=720
airplay.fps=24
airplay.width=1920
airplay.height=1080
airplay.fps=60
airplay.hls.enabled=false
# player (gstreamer, ffmpeg)
player.implementation=gstreamer
player.tray.enabled=true
Expand Down Expand Up @@ -96,6 +97,10 @@ Set `dump.enabled=true` to record beside the live player under `dumps/<timestamp
- `media/` — decrypted `.h264` / remuxed `.mp4`, audio `.caf` / `.aac`
- `extras/` — HLS playlists, artwork, DMAP metadata when present

## Known issues

- YouTube sometimes shows an empty black window on the phone while its interface is drawn on the receiver. That happens when screen mirroring is already on and the receiver advertises video. `airplay.hls.enabled=false` leaves mirroring and audio without that video advertisement.

## Related projects

This monorepo unites the former:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ public class PlayerConfig {

@Bean
@ConfigurationProperties(prefix = "airplay")
public AirPlayConfig airPlayConfig() {
return new AirPlayConfig();
public AirPlayConfig airPlayConfig(@Value("${airplay.hls.enabled:true}") boolean hlsEnabled) {
AirPlayConfig config = new AirPlayConfig();
config.setHlsEnabled(hlsEnabled);
return config;
}

@Bean
Expand Down
1 change: 1 addition & 0 deletions player/app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ airplay.serverName=srzhka
airplay.width=1920
airplay.height=1080
airplay.fps=60
airplay.hls.enabled=false
# player (gstreamer, ffmpeg)
player.implementation=gstreamer
player.tray.enabled=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public FFmpegPlayer() {
public FFmpegPlayer(int fps) {
this.fps = Math.max(1, fps);
hls.setOnEnded(() -> observer.onEnded());
hls.setOnPresented(() -> observer.onPresented());
hls.setOnSeekDisplayed(() -> observer.onSeekDisplayed());
log.info("FFmpeg debug log: {}", NativeProcessLog.playerLogFile("ffmpeg"));
}

Expand All @@ -47,18 +49,12 @@ public synchronized void onVideoFormat(VideoStreamInfo videoStreamInfo) {
FfplayPcmSink.applyDisplayEnv(pb);
NativeProcessLog.configureProcessLogging(pb, "ffmpeg");
h264Process = pb.start();
// SDL may abort after start if the display/audio driver is wrong.
Thread.sleep(150);
if (!h264Process.isAlive()) {
h264Process = null;
throw new IllegalStateException("ffplay exited immediately after start");
}
} catch (IOException e) {
throw new IllegalStateException("Failed to start ffplay. Make sure it is available on PATH.", e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
stopVideoProcess();
throw new IllegalStateException("Interrupted while starting ffplay", e);
}
}

Expand Down
Loading
Loading