I've created an AirPlay receiver addon for Kodi.
It supports screen mirroring, casting videos, and audio.
It is played through Kodi's own pipeline so hardware decoding, the normal renderer and the usual playback controls all apply.
Video protected by DRM cannot be received. Youtube does work.
To test, install the repo zip file and use install from zip file in kodi.
You MUST disable "Enable AirPlay support" in settings/services (this is the old, audio only airplay).
Then you can install Airplay Receiver from the popcornmix repo.
In settings:
* Offer screen mirroring - enables the screen mirror option on AirPlay device
* Play sound from mirroring - if disabled improves latency
* Stream video from apps instead of mirroring - will switch from mirror stream to direct video playback when available
* Let the sender change the volume - adjusts kodi's volume when clients volume is changed
* Low latency mode - disable for now - needs updates to kodi
* Ask new devices to pair - kodi will show a PIN code than needs to be entered on client
Tested on Pi3, Pi4 and Pi5. Built for x86 but untested. Should work on Matrix or Piers.
Source is here.