How I got my now playing to work

In this topic I'm helping people get there now playing
Working as I did

So first on the designer

I made a text box for now playing
Then for the cover artist I placed a web viewer In that web viewers HomeUrl I placed the Live365 embedded URL made the height and width to fit

Underneath yet another lable box for Loading Current Track(NOTHING TO DO HERE) but you rename it now playing or whatever you wish to call your lable

If your adding a clock to your project in designer set that to 5000ms

In blocks you add

When clock or whatever you name it .timer DO
Set Web_Nowplaying.url to text box
Now do this whoever your streaming with
May it be radio.co, live365 ect you left click
Inspect element goto the network tab press xhr or media
You'll find the streaming players or now playing API URL there

You then copy that API URL put it in that text box after you set web_nowplaying.url block with a text box

Underneath that you call a purple block web_nowplaying.get

Then you add the blocks in order for this to work for example recently played so you grab the block when recently played.gotText DO add a if then block to that

You go into the math draw grab an equals block the equals that's in the middle

You then make a couple of orange bars rite up the top rename them as seen in the image

you then plug the blue empty :jigsaw: = :jigsaw: into the if section the first empty box you place ResponseCode after = you place 200

In the Then Section again orange
set global json_data to call the purple block web_nowplaying.jsonTextDecode
JsonText now on the end of that you add orange get response content

Underneath that you add set global artists to dark blue get value for key in dictionary or if not found block

You add in the key part text block and put artist

In dictionary you add set global json_data in the if not found you add another text block and add unknown

Underneath all that you a dark green block
Set Label_NowPlaying.text To

Again remember I meantioned about dictionary block yes you got your adding that again to this but this time

In key your adding a blank text box and typing title
In dictionary your adding the same orange block
Get global json_data

Or if not found = another text box again your typing unknown

Images to help as well



A post was merged into an existing topic: Trying to have now playing in my app