benkaiser / stretto

Beautiful web-based music player
https://next.kaiserapps.com
MIT License
619 stars 96 forks source link

Remote control #160

Open xtrm0 opened 3 years ago

xtrm0 commented 3 years ago

I want to control the output of one computer that is connected to my speakers without having to open that computer.

We could allow the server to generate a url that allows remote control from the client in terms of what song is being played on the client that generated the url (and on the client that opens the url, he can see a mirror of the client that plays music in terms of what music is being played and the songs in the library).

The generated url could just be used to establish a webrtc connection between the player client and the controller clients.

In terms of changes to current functionality:

What do you think? @benkaiser

benkaiser commented 3 years ago

So technically the /remote endpoint begins to implement the basics of this remote controlling (although it seems pretty broken since I haven't used it in ages). It only surfaces the play/skip buttons and no browsing buttons.

It would be cooler to have it be the exact same UI but with a different "output" device selected.

Honestly as a temporary workaround, have you thought about just putting a bluetooth receiver in place of the computer attached to the speakers?

Implementation-wise I think you're right, I think the neatest way to control it would be to replace the "player" class with a "RemotePlayer" and have all the controls go through WebRTC to the other machine. You'll have to deal separately with surfacing the UI state (play/pause won't update, seek position won't update, etc), but that should be the basics of what you're trying to achieve.

Are you wanting to make the change? Happy to work with you on a PR

xtrm0 commented 3 years ago

I can take a look at it sometime during the holidays :)