juhovh / shairplay

Apple airplay and raop protocol server
Other
1.34k stars 226 forks source link

How to test screen mirroring? #79

Open treblam opened 5 years ago

treblam commented 5 years ago

I have noticed the document said:

The library has experimental support for handling fairplay handshake (used in for example screen mirroring)

But when I open screen mirroring with iOS 12.1.4, the fairplay device is not displayed. I also tried to open screen mirroring on macOS 10.14.3, and it's not displayed too.

So how can I test fairplay with screen mirroring? Any help will be appreciated.

treblam commented 5 years ago

I have looked at the source code for a quite a while, and found this file (src/test/main.c) have airplay related test code in it, and it includes airplay.h, but there is no airplay.h and airplay.c files in the source code. @juhovh Would you please commit these files to the repo? otherwise the file src/test/main.c can't be properly compiled.

juhovh commented 5 years ago

Sorry for the bad documentation, the service needs to advertise itself properly as AppleTV to be able to show as a screen mirroring device. Also, I believe the used playfair DRM decryption code only works for iOS devices and not macOS.

If you want to make shairplay advertise itself please see the https://github.com/juhovh/shairplay/commits/handshake-test branch, but you should be aware that I might rebase this branch from time to time when I'm doing development. I haven't enabled it in the master branch, because the mirroring handshake support is not complete, currently it can only handle the audio handshakes.

I think the test code is out of date, should also update that.

treblam commented 5 years ago

The handshake-test branch seems to be missing one line of code, which caused my iOS 12.2 can't find airplay server, I have made a pull request to it.

And I'd like to know why playfair DRM decryption code only works for iOS devices but not macOS, is it because they use different decryption method?

I'm interested in making the mirroring handshake work, but I am a newbie in C language, if you can spend some time on this, and make it work, it would be great. Thanks.

HuangKaiHuan commented 5 years ago

Sorry for the bad documentation, the service needs to advertise itself properly as AppleTV to be able to show as a screen mirroring device. Also, I believe the used playfair DRM decryption code only works for iOS devices and not macOS.

If you want to make shairplay advertise itself please see the https://github.com/juhovh/shairplay/commits/handshake-test branch, but you should be aware that I might rebase this branch from time to time when I'm doing development. I haven't enabled it in the master branch, because the mirroring handshake support is not complete, currently it can only handle the audio handshakes.

I think the test code is out of date, should also update that.

HI. I find someone had implemented the mirror function in ios12 based on this project.https://github.com/dsafa22/AirplayServer. But it is for android system. I'm trying to merge his code to yours. But I'm not good at doing it.
I hope it will help you and I will continue to work hard.

HuangKaiHuan commented 5 years ago

I combine two pieces of code in https://github.com/561546441/shairplay the mirroring handshake seem to be success。 But I can not find the mirroring stream from client. Can you spend on a little of time to see why? @juhovh

drscotthawley commented 3 years ago

Same problem here: Configured with ./configure --with-playfair but shairplay instance never appears on iPhone's screen mirroring list. (iOS 14)