Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote control #160

Open
xtrm0 opened this issue Dec 7, 2020 · 2 comments
Open

Remote control #160

xtrm0 opened this issue Dec 7, 2020 · 2 comments

Comments

@xtrm0
Copy link
Contributor

xtrm0 commented Dec 7, 2020

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:

  • We would have to change the player.js::saveState to inform the server of the playstate, which we would share with all the connected controller clients. (The server would have to allow to broadcast the player library information and on player.js::saveState it could periodically also broadcast that state, this way the client's could just see copies of the state of the server).
  • We would have to make everything that depends on gettings saving to localstorage on the controller clients to just nop.

What do you think? @benkaiser

@benkaiser
Copy link
Owner

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
Copy link
Contributor Author

xtrm0 commented Dec 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants