Implementing android as a server (receiver) in airplay
Asked Answered
S

1

12

I want to create the airplay in android in which my android device will work as a airplay server(receiver)and iPhone device will work as a receiver . I have used jmdns in my application which is open source library in java for the airplay . It is working fine for the audio . But when I come to the video and image then there is lot of struggle for me even with the discovery of the device .Here is my code for the creating and registering the service :

    ServiceInfo info = ServiceInfo.create(identifier + "@" + name + "._raop._tcp.local", identifier + "@" + name, port, "tp=UDP sm=false sv=false ek=1 et=0,1 cn=0,1 ch=2 ss=16 sr=44100 pw=false vn=3 txtvers=1");

        dns = JmmDNS.Factory.getInstance();
        ((JmmDNSImpl)dns).inetAddressAdded(new NetworkTopologyEventImpl(JmDNS.create(InetAddress.getByName("localhost")), InetAddress.getByName("localhost")));

        try {
            Thread.sleep(1000); // If this isn't done the Announcement sometimes doesn't go out on the local interface
        } catch (InterruptedException e) {
            e.printStackTrace(System.err);
        }

        dns.registerService(info);

when i change that ._raop in the first line to the ._airplay then the device has been discovered for the image and audio in the iPad. When i select the device for playing the video the it show the message "This video is playing android(server name )". But in server side i am not getting any packets to process. I am studied Jmdns lot . But i am not getting how to implement the video and image in the airplay using jmdns . Any ideas ?

Stoeber answered 28/2, 2013 at 5:26 Comment(4)
JmDNS does nothing rather than a bonjour greeting. in your Android server app, you need implement a Http Live Streaming server (for serving photo and video) by using other existing library or from scratch.Codd
@yorkw:so is there any existing library to achieve this ?Stoeber
@Stoeber Can u please help me a little?Cockscomb
@KanakSony: ohh ! sorry for the late reply . But the problem is I could not find that code . But I will try my best to get back that code.Stoeber
V
4

You need a streaming server. FFmpeg seems to me an interesting place to start. See the ffserver component.

Here is a nice tutorial on how to wrap it in ffmpeg-java.

Vivi answered 14/3, 2013 at 6:14 Comment(1)
Additionally, I found this: #1245361. Just in case FFmpeg somehow doesn't work for you.Vivi

© 2022 - 2024 — McMap. All rights reserved.