4

Is there are way to do this. I couldn't find to much in the apple documentation. Sorry if I'm totally missing this. I know my way around code. I'm 16 and kind of new to some of this. I have some apps on the app store so I know what I'm doing but still a little fresh with all of this. Thanks. I know there is this AirPlay Mirroring iPhone to Mac OS / using UIWebView + AirPlay and it's probably easier to just buy it but is there a way to do it. I have a 4s so i know it can handle mirroring.

Community
  • 1
  • 1
evan.stoddard
  • 698
  • 1
  • 5
  • 22
  • Also, isn't the server built in it's just opening the port? – evan.stoddard Jan 02 '13 at 00:58
  • 1
    You're listing iOS and OS X in your tags. Which one are you after? The technology is implemented differently. Also it's hard to tell what you mean by "AirPlay server". I would typically think that would mean you need to know how to push **out** video from a device to any device on the network that's registered as an airplay-capable device. However from your link it sounds more like you're wondering about how to register your app as being able to handle an **incoming** airplay video stream and how to actually handle it. – Jack Lawrence Jan 02 '13 at 01:42
  • 1
    Oy. Apparently @KendallHelmstetterGeln changed your question title from one that is arguably much clearer. Rolling it back now. – Jack Lawrence Jan 02 '13 at 01:49
  • What I want is for my mac to act as an airplay server and my iphone to view it as an airplay device that it can mirror on. This has nothing to do with coding for the iphone. It has to do with making an app like airserver and reflection so I can view my iphone screen on my mac through airplay mirroring. – evan.stoddard Jan 02 '13 at 01:52
  • 1
    Understood, thanks for clearing that up. AirServer and Reflection reverse-engineered the AirPlay protocol and broke the encryption on the stream so you would have a fair amount of work replicating what they've done. I haven't been able to find any actively maintained open-source code. Good luck! – Jack Lawrence Jan 02 '13 at 02:06
  • 1
    @Jack: I totally disagree the original title is clearer; it's what led me to post a reply noting that he needed an airplay server to begin with. My change clearly indicated he needed source to write an Airplay server which is now totally unclear to the reader. I'l leave it as-is but no responses will likely be forthcoming if they just think you are confused about how AirPlay works. Evan, I strongly recommend you re-word either your question or title to make your needs clear. – Kendall Helmstetter Gelner Jan 02 '13 at 02:09
  • I think you need to relax, the title currently is very clear. It states that I need help getting my iPhone's screen onto my macs screen through AirPlay, you click on it and see a conversation and then your questions will be answered. – evan.stoddard Jan 02 '13 at 02:14
  • 1
    @KendallHelmstetterGelner Fair enough. I disagree about the usage of the phrase "airplay server" because he's really looking for how to make an airplay client/device. For example, an Apple TV is an airplay client. It receives audio/video streams. My iPhone is an airplay server; It sends streams to clients. I also disagree with the source code request. He doesn't imply whether or not he's comfortable reading documentation/writing code with some help. Many people (including me) on stack overflow ignore questions that just ask for pre-written code. I agree that both could be reworded a bit. – Jack Lawrence Jan 02 '13 at 02:18
  • I know in the iPhone develoers cookbook by Erica sadun, there is a action where she works with bonjour. This is a little off topic so if it goes much further ill ask a new question. But what happened is she used bonjour and then made a Mac app that captured a picture of the screen while in the app. If I take that code and modify it a bit, can it act as a client and run in the background to allow pictures to be taken. Or will this not work because of sandboxing and other stuffy imaginative brain is not realizing. – evan.stoddard Jan 02 '13 at 02:22
  • Also I know these are just pictures but if you take a couple quickly you will have a really slow frame rate but it will still be "video". Not practical by any means but now I just want to make it to prove a concept. – evan.stoddard Jan 02 '13 at 02:22
  • 1
    Yeah so the difference is that you're _in_ the app on your iphone. It's totally different technology. – Jack Lawrence Jan 02 '13 at 02:24
  • I'm comfortable with code but there is nothing in the apple documentation and I knew there wouldn't be because if there was then I would t be asking this question because apple would probably have a way. Plus since you have to reverse engineer AirPlay in order to do this it obviously wouldn't be in the apple documentation. – evan.stoddard Jan 02 '13 at 02:27
  • I'm not asking for code I'm asking if there are any resources or libraries to help. For instance reflection use a third party libav codec for their app. That would be what I'm looking for. Stuff like libraries and ideas. I'm not asking for you to code my whole program for me. – evan.stoddard Jan 02 '13 at 02:28
  • I figured that the app thing wouldn't work. That would be better for show casing a specific app, you would add that bit of code and have an app. Kind of like the screenshot thing in Xcode except in a smaller more specific scale – evan.stoddard Jan 02 '13 at 02:29
  • 1
    Exactly. Also a good exercise in your OSX/iOS programming ability! By the way you get insta-killed if you attempt to run UI code while your in the background so asking UIKit to take an image rep of the screen would get your app killed. Just an FYI for basically why that doesn't work. – Jack Lawrence Jan 02 '13 at 02:32
  • Thanks for the compliment as well as the tip!:) – evan.stoddard Jan 02 '13 at 02:40
  • @evan: All libraries are just code, that's why I said you were looking for code - any library you can't have code for would cost money, just like the servers you can already buy. – Kendall Helmstetter Gelner Jan 02 '13 at 05:14
  • @Jack: Technically your use of "server" here is correct but confusing. Even the commercial products that act as an Apple TV on your mac is called "AirServer" not "AirClient". An AirPlay client library for node.js exists to browse AirPlay devices, not consume feeds. I agree that AirPlay Receiver might be an even better term, but using the term AirPlay server most would understand to mean the thing that consumes data, not the thing that produces it. The current title gives you no idea if the desire is to build something to play to AirServer, or replace it. – Kendall Helmstetter Gelner Jan 02 '13 at 05:24
  • Ok thanks, I hope I didn't come across as rude. – evan.stoddard Jan 03 '13 at 15:24

1 Answers1

3

Possible duplicate of Decoding AirPlay Mirroring Protocol.

As explained here basically the stream is encrypted using FairPlay™, the same technology that encrypts apps and movies purchased through iTunes.

In order to do what you want you would need to reverse-engineer FairPlay. That's the only way I can think of that the existing apps you mentioned are doing it, but I'm not sure... It would be interesting if someone could elaborate further. Regardless the point is, it's not trivial.

Here is the protocol: http://nto.github.com/AirPlay.html

Community
  • 1
  • 1
Jack Lawrence
  • 10,664
  • 1
  • 47
  • 61