title: How to get the currently playing song (on the device) title in Swift?
body: <p>I'm currently coding an app which displays a livestream embedded with an iframe loaded with WKWebView (loadHTMLString).</p>
  
  <p>I want to show a "Loading" icon and label whenever the livestream is loading (or even buffering but not a big deal if I can't check if buffering).</p>
  
  <p>Solutions I found:</p>
  
  <p>1) Trying to listen for a media to be played with Javascript which then will send a message to the Swift code and put the "Loading" label in front.</p>
  
  <p>Problem: It will be difficult to listen for a media to be played due to same-site policy (I can't access the body of an iframe downloaded from another source) and as I looked on loads of sites it seems to be difficult to send a message to Swift (I'm new to Swift).</p>
  
  <p>2) Trying to look at the title of the song playing on the device (the title that is shown on the Control Center) because I noticed that whenever a livestream is being played in my app it would appear in the Control Center with the name of the site hosting the livestream.</p>
  
  <p>I tried to look at multiple things but couldn't find one actually working.</p>
  
  <p>3) Trying to look if something is being played with <code>MPNowPlayingInfoCenter.default().nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate]</code> (and an infinite loop with timer which might not be the greatest solution)
  Or something like that.</p>
  
  <p>But it seems like it always throws me <code>nil</code></p>
  
  <p>As said before, I'm new to Swift (started like 2 days ago) and don't really understand lots of things but if someone could explain to me how I could solve my problem (if there is one) I would be super grateful!</p>