Airplay is a communication protocol for sharing multimedia data between heterogeneous devices in the LAN. Airplay devices include clients and servers. Generally, small-screen IOS devices are implemented as Airplay clients and large-screen devices are implemented as Airplay servers. IPhone, iPad, and iPod are generally Airplay clients, and iTV and Macbook are designed as Airplay servers to share videos, photos, and music between small and large screens. Airplay is a proprietary protocol and is copyrighted by Apple.
The number of IOS devices is very large. If the Android set-top box supports the Airplay protocol of IOS devices, it is implemented as an Airplay server, the ability to receive and process multimedia data (videos, photos, and music) from IOS devices will improve the competitiveness of the Android set-top box.
Technical point analysis: The Airplay Server includes three services: DNS Service Discovery Service; HTTP-based Airplay service and UDP-based Airtunes service. The DNS Service Discovery Service has an open-source AVAHI library in linux. The other two services must be implemented based on the Airplay protocol.
1 Airplay concept Diagram
Airplay client: iPhone, iPad, iPod, and other IOS devices
Airplay server: iTV, Macbook, AndriodTVBox
Network: Wifi Wireless LAN
Airplay Server protocols: DNS Service Discovery Protocol, HTTP protocol, TCP/UDP protocol, and Airplay Protocol
Services included in the Airplay server: DNS Service Discovery Service, Airplay service, and Airtunes Service
2. Some Airplay open-source code (fewer Android platforms)
Servers |
Name |
Description |
Open |
AirServer |
The best app for turning your Mac into an AirPlay screen |
- |
Reflection |
Turn your Mac or PC into an AirPlay screen |
- |
Banana TV |
Another app to turn your Mac into and AirPlay screen |
- |
Casual Share |
Mac AirPlay receiever |
R |
AirMac |
Turns you Macintosh into an Airplay Explorer (Objective C) |
R |
Airstream Media Player |
C # based AirPlay screen for windows and AirPlay server source code |
R |
Play2Wifi |
An AirPlay server written in Python |
R |
3. Airplay implementation on the Android platform
Brief description: There are two most important steps to implement Airplay. The first step is to release the Airplay service so that the IOS device can discover you. The second step is to implement the Airplay Protocol response, allows IOS devices to interact with you. Airplay Publishing Service, which is the original Zeroconf protocol in Linux, used to publish network services. The Zeroconf protocol is not supported on the Android platform. Therefore, you need to install Avahi of Linux, which is the Linux implementation of Zeroconf. The Avahi Service publishing management system supports cross-process Publishing, in which cross-process data interaction is performed through container-Service. The ghost service comes with the Android native system.
The dependency between the system library is described above. The following describes how to implement it.
1) modify the permissions of the DUBS-Service (Andriod) Service. The default value is Bluetooth, which can be accessed by system-level programs.
2) compile a new service zero-configuration Network release service ZeroconfAvahiService, which encapsulates Avahi service and Avahi-client. In the Android configuration file, enable the Service to start automatically.
3) In the AirplayServer program, create Avahi-client and publish the Airplay service. If the IOS device can find your Android device, congratulations to the successful release of the service.
4) AirplayServer implements the Airplay protocol and interacts with image and video data of IOS devices. Coding and Debugging will always succeed.
4. Feelings
I learned how to implement Airplay on the Android platform. It is amazing that diaosi devices can interact with fushuai devices. However, Airplay is not the only technology. DLNA and WifiDisplay have similar functions.