I've managed to use MusicKit JS inside a WKWebView for playback. I wrote a small script that loads and configures MusicKit JS and attaches some functions like play/skip etc. to the window object to be called from Swift using webview methods. Events from player can also be sent back to Swift code using WKScriptMessageHandler.