Midterm Project – Santarelli

From last week I learned that I needed to use a CDN in order to get the webpage to load properly on my computer’s browser, so I started with getting that to work. I was surprised to learn that apple already has a CDN for Apple Music so I started implementing that into my website. https://js-cdn.music.apple.com/musickit/v1/musickit.js You can use the JS api through this version and made things a lot easier because I could then reference those from declarative mark up elements where all the hard work was already completed for us. The markup elements do some of the tricky parts especially with interacting with the microcontroller in a webpage setting because it already starts to look like some sort of player but more barebones. This demo player was good but it had more information than was really needed and could’ve been clearer to the user on what it should be.

From here I refined it from just picking a random apple playlist to one of mine and getting it to correctly work. I found the playlist identifiers and chose a specific one to try out with this player. I styled it and added other pieces, and just as importantly removed things that weren’t as important to 1. keep it a lightweight player, and 2. not distract you from the point in the first place which is, it’s suppose to be in the background.

This is what it turned out to be. I had issues getting the authorization through apple’s services to work on the microcontroller because if I set the controller to refresh, it would immediately unauthorize, drop the queue of the songs and start again. Even if you started playing after awhile. So then I started looking into keep-alive connections because the microcontroller was purposely dropping a connection after 5 seconds even after I didn’t tell the client to close. It became harder and harder to get the microcontroller to register the button clicks to skip because it would do it only after the connection was dropped. I looked into other web libraries for the esp8266 on github but after trying it out and looking with the other issues people had, the controller always overrode and closed the connection after a couple of seconds. I really want to be able to build this the proper way and get it working but in order to do so I have to do it somewhere else. However I was very proud that I was able to get a player to properly play my personal playlist from apple music and host it on the microcontroller.