FDH2 / UxPlay

AirPlay Unix mirroring server
GNU General Public License v3.0
1.35k stars 72 forks source link

New client connection to disconnect any other connected client #141

Closed gregd72002 closed 1 year ago

gregd72002 commented 1 year ago

This is a feature request.

There should be an option that instruct UxPlay on new connection to disconnect any existing client.

Context, In a home with multiple iPhones or iPads, sometimes it happens a device continue to be connected to the audio AirPlay and being paused. Currently it is needed to find the device and disconnect it before attempting to connect a new device. If the option is used, the new device should take precedent over the currently connected one (disconnect the old one)

fduncanh commented 1 year ago

The opposite feature request is implemented: you cannot connect until the current client releases the connection. This prevents a third party from pushing you off.

An apple TV can handle multiple connections, but the protocol (stream_connection_id) for keeping them separate its not entrirely clear.

Maybe there is some way to detect a "connected but inactive" client?

Or maybe a new option that allows a new client request to take over the connection, that is off by default? Ah, that is what you propose

fduncanh commented 1 year ago

see #54 which was the feature request that was implemented to prevent new clients taking over.

It may be possible to add an option to "undo" this: It seems a client generally makes two connections. (maybe only one in "audio only mode") it might be possible to have an option that allows a third connection to be made, and then terminate the two existing ones.....

fduncanh commented 1 year ago

This actually looks pretty easy. Stay tuned.

fduncanh commented 1 year ago

What you wanted is now implemented as an option -nohold in the "testing" branch of UxPlay (select "testing" instead of "master" on the UxPlay github page.)

Please test and report back with any issues. Can you suggest a better/shorter name for the option?

gregd72002 commented 1 year ago

Thanks for the very prompt response!

Code compiled well, just need some time to test it. Will revert back soon.

fduncanh commented 1 year ago

The requested option was tested and seems to work correctly. Its now in the new UxPlay 1.58 release.