NOTE: A newer revamped version of the radio has been completed and is available here: https://flightsim.to/file/46238/fsradio
Development on this version is hearby discontinued.
Have you ever wanted to control Spotify from within Microsoft Flight Simulator 2020 without having to minimize MSFS to open the Spotify application? How about controlling just the volume of Spotify without affecting the game volume? Well now you can!
Display a VR compatibale Spotify in-game remote in a Microsoft Flight Simulator 2020 toolbar panel.
Installing
- Extract the contents of the "Client" folder into your MSFS 2020 Community folder.
- Extract the contents of the "Server" folder into a location of your choosing.
- Run SpotifyPanel.exe and click on the Settings icon. You will need to provide your own Spotify developer keys.
- Go to the Spotify Developer Dashboard to create or find your keys. Ensure that your Spotify application has a Redirect URI for http://localhost:52000 and http://localhost:52000/ (yes, you need one with and without the trailing slash). This URI is used to pass the Authentication Token from Spotify back to Spotify Panel.
- (Optional) Add SpotifyPanel.exe to your EXE.xml so that it automatically launches when you run MSFS 2020.
Running
Spotify Panel will run in the system tray. Right click on the system tray icon to show or close the server application. Additionaly, you may double-click on the system tray icon to show it. Once Spotify Panel is configured with your Spotify developer keys, subsequent launches of Spotify Panel will load minimized into the system tray. After entering your Spotify developer keys, Spotify Panel will open an embedded browser in order for you to authenticate and give permissions for it to pull information from your Spotify account. After that, refreshing the token should happen without any user intervention.
F.A.Q.
Q. Do I still need Spotify installed?
A. Yes you do. Spotify Panel is simply a remote control that controls Spotify. If you want to hear Spotify in your headphones along with the MSFS 2020 game sound, you will need to have Spotify installed and running on the same computer.
Q. MSFS 2020 panels use HTML natively. Why do I need a server application?
A. MSFS 2020 uses iFrames in their panels to serve up HTML. While this would be ideal, Spotify, in their infinite wisdom, has decided to prevent authentication from within iFrames. Perhaps someone smarter than me can explain the security concern they have.
Q. Why do I need to provide my Secret ID as well as my Client ID?
A. By default Spotify authentication will pass the authorization token back to your web browser via a URL hash. Because we can't authenticate from within MSFS, because of the aforementioned iFrame issue, we have to get the authentication from a URL parameter. Since URL hashes are not visible to the server we must provice the Secret ID so that Spotify passes the token back as a standard URL parameter.
Q. What port does Spotify Panel use?
A. 5150
Q. If I forward port 5150 from my router and open an incoming firewall rule, can an external browser access my data?
A. No. Binding is to localhost (127.0.0.1) only.
This a great initiative, it is a game changer literally for me.
It should be explained better, maybe with a video.
My issues were:
Issues -
Is it possible to fix the above?
Is this project open-source on Github to be able to share the development?
1 years ago
I have updated the instructions to clairify that Spotify needs to be installed and running.
! am not sure why you cannot copy and past the redirect URI in the instructions.
I will look at the volume. However, this application is more of a proof of concept and a new reimaigined version will be released before the end of the year.
I am not sure what you mean by "zoomed-out." As you can see from the screenshots that I provided my windows are not "zoomed-out" and small. It sounds like something with your installation of MSFS 2020 and how it renders HTML. I did see something that might be what you are talking about when I toggled between fullscreen and windowed view once.
Yes, the code is on GitHub. Search for MSFS 2020 Spotify Panel
1 years ago
Gafman
liazkam
„Have you ever wanted to control Spotify from within Microsoft Flight Simulator 2020 without having to minimize MSFS to open the Spotify application?“
No. But now since I saw the Manowar album cover I feel the urge to try it out \m/
😉
As for the „iFrame security concerns“: I am not a web developer respectively web security specialist, but I could imagine that this a simple way to prevent evil websites that have managed to get unsuspecting visitors to connect with some „fake Spotify URL“ (or my changing the local HOSTS file, rerouting DNS traffic etc.) to simply embed the original authentication page and then fetch the entered credentials via JavaScript - or rather capture the sent back security token etc.
1 years ago
Steeler
Flashing panel when in the sim - shows the artwork for a second before going black - repeatedly.
1 years ago
The the new version 1.3.2.
1 years ago
Gafman
gibboireland
Hey Gafman, it is working flawlessly now with the latest update 😊
Kudos for the idea behind the 5150 port... I had a feeling there was some Van Halen reference there 😉
1 years ago
ZachB
It keeps reading
1 years ago
You'll have to open up spotify on your PC and hit play there the first time. That is a limitation of Spotify's Web API.
1 years ago
Gafman
Sousaboi865
is it possible to do a youtube app
1 years ago
even better it should be a browser app so you can do it all
1 years ago
JV8R
nuuk
I can't seem to get it to work. I keep getting INVALID_CLIENT: Invalid redirect URI when opening, made sure the port is clean and my Spotify ID and Secret is 100% accurate.
1 years ago
same problem here too
1 years ago
mrroba
WWALKER0
Entered my keys and got the "port 5150 already in use" after trying to sign in using my Facebook account error. I ran some commands and found that only the spotify panel was using that port. I killed the process and tried again only to get an invalid url error?
1 years ago
try the new version with the amended installation instructions.
1 years ago
Gafman
ChiefGaming685
Hi, I have entered my keys, however I get a "port 5150 already in use" message -- I narrowed it down to Chrome using that port, and closed it out along with ending any associated processes, but still get the message. Do you know if there is a way around that? Nonetheless, this is awesome!!
1 years ago
I've no idea what you would have that would be using that port. Try from a command prompt with administrator permissions: "netstat -a -b -n" You will have to scroll up a bit. You could also do "netstat -a -b -n > ports.txt" and pipe it to a text file. Search for 5150. It will show the name of the exe using that port below it.
1 years ago
Gafman
ZachB
Very cool! I'm glad to know this is possible even with the caveats. iframes are an absolute pain and though I wish Spotify would allow it, I understand why they won't. They are a compatibility nightmare moreso even than a security concern. They are going the way of the dinosaur it seems. We had to stop supporting them for our customers, specifically because they weren't compatible with our authentication. In brief, it's a CORS issue most of the time. Clever solution on your part though and worth the extra steps I'd say if only as a proof of concept.
1 years ago
I justed updated it again, this time using the WebView2 embeded browser. Doesn't do the popping of the external browser anymore.
1 years ago
Gafman
CalsFM
Brings a smile to my face that you showcased Manowar in your thumbnail. I don't think there are many of us fans in the FS community.
1 years ago
I love me some Manowar and power metal!
1 years ago
Gafman
willyj2242