❔ How can I control the media playing on my computer using .NET?

I want to control the currently playing music in my computer using C#, I tried using ChatGPT to give me an idea, and had no luck. Any help will be appriciated.
12 Replies
reflectronic
reflectronic16mo ago
what do you mean by controlling the currently playing music you mean, like, music that is being played by other applications?
דן המזוהם
דן המזוהםOP16mo ago
Yes (Sorry for the delay, I wasn't home) I want to control youtube music on my laptop through my phone
reflectronic
reflectronic16mo ago
there are two hard parts to this. one of them is getting your phone to talk to the computer. the other one is getting the computer to control the music both are entirely separate problems, you can find solutions to them independently and sort of just 'hook them up'
reflectronic
reflectronic16mo ago
GlobalSystemMediaTransportControlsSessionManager Class (Windows.Med...
Provides access to playback sessions throughout the system that have integrated with SystemMediaTransportControls to provide playback info and allow remote control.
reflectronic
reflectronic16mo ago
i think the API is pretty self-explanatory the other part is probably the harder one, you need some kind of server running on your PC and a phone app that can send requests like "pause" "play" "change volume" etc. to that server my first thought is to use ASP.NET to make a simple web API, and you write a phone app that can call it. or even just a website that you can connect to from a web browser (you would probably want to keep that server on your local network, not the internet, unless you care to implement authorization of some sort)
דן המזוהם
דן המזוהםOP16mo ago
Getting my phone to communicate with my computer is not a problem, I'm gonna use websockets and the c# program is going to run as a service in the background, my problem is control the media in the computer using C# or even simpler, HttpListener Is there a way to use this through a console app? instead of UWP sorry if it's a dumb question, I'm new to C#
reflectronic
reflectronic16mo ago
in your project properties, you want to set these
reflectronic
reflectronic16mo ago
here it is reading my youtube information
דן המזוהם
דן המזוהםOP16mo ago
I will try this
דן המזוהם
דן המזוהםOP16mo ago
God bless you man
דן המזוהם
דן המזוהםOP16mo ago
wishing you the best For real I haven't found a soulution and I've been searching for hours little question how do you know all of this projects from the past?
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server