Album cover on website

You have a question or need an advice about how to do something? Ask it here!
User avatar
rockdj
Posts: 23
Joined: 25 Feb 2013 16:44
Album cover on website

Post by rockdj »

Hi Bernd,

I'm new at this forum. I have a question. Is it possible in PF that the album cover of the currently playing track is send along with the song info, so that it will be displayed in a webplayer on my website? e.g. like this http://www.rockfiles.nl
rockfiles.nl 110% rock radio!!
the no.1 rock & metal station!!
User avatar
radio42
Site Admin
Posts: 8321
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Album cover on website

Post by radio42 »

There is already a v4.0.4.19-beta out (use "Check for Beta-Versions..." to update).
This version contains a new control command called: EXEC_WRITE_JPEG_FILE, which writes any track's album art image to a file.
Parameters: filename[|from[|size]]
Note: The filename should denote the full path to a .jpg file; what can be '0'=current track (default), '1'=next track, 'A'=current player A, 'B'=current player B, 'C'=current player C, 'D'=current player D; size defined the quadratic with/height (default is 200).
Example:

Code: Select all

EXEC_WRITE_JPEG_FILE C:\Test\NowPlaying.jpg|0|300
User avatar
radio42
Site Admin
Posts: 8321
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Album cover on website

Post by radio42 »

Yes, but that is not as easy as you think it might be :-)

ProppFrexx contains several macros which can be used to 'send' a cover art image:
- ${albumart}
- ${cpltrackalbumartcurrent}
- ${cpltrackalbumartnext}
- ${cpltrackalbumarta}
- ${cpltrackalbumartb}
- ${cpltrackalbumartc}
- ${cpltrackalbumartd}
- ${plstrackalbumartcurrent}
- ${plstrackalbumartnext}

These macros can be used exactly like any other existing macros which you might use to transmit the song title, artist etc. to your web-site.
E.g. via the following control-commands:
- EXEC_SEND_HTTP_GET
- EXEC_SEND_HTTP_POST
- EXEC_WRITE_PLAYLISTFILE (see here for details http://www.proppfrexx.radio42.com/myBB/ ... php?tid=72)

Note, that above album art macros resolve the cover art image of an audio track (if existing) to a Base64 encoded string containing the binary image data of a Jpeg image.
This means:
- ProppFrexx reads any existing track image
- converts that to a Jpeg image of size 200x200
- uses that converted image and used a standard base64 encoder to convert that to a string

On your web-site (when receiving/reading that base64 image string) you must:
- decode that received string back to binary data (e.g. via the PHP 'base64_decode' function)
- use that decoded binary data to create the image on your web-site
- use the 'image/jpeg' mime type for that!
User avatar
rockdj
Posts: 23
Joined: 25 Feb 2013 16:44
Re: Album cover on website

Post by rockdj »

Thank you for your answer. I will try to fix it. :D
rockfiles.nl 110% rock radio!!
the no.1 rock & metal station!!
User avatar
rockdj
Posts: 23
Joined: 25 Feb 2013 16:44
Re: Album cover on website

Post by rockdj »

Hi Bernd,
I,m still trying to fix my problem. I already found, how to get the song info in my webplayer. But in wich command do I fill in this info:
- ${albumart}
- ${cpltrackalbumartcurrent}
- ${cpltrackalbumartnext}
- ${cpltrackalbumarta}
- ${cpltrackalbumartb}
- ${cpltrackalbumartc}
- ${cpltrackalbumartd}
- ${plstrackalbumartcurrent}
- ${plstrackalbumartnext}

Could you help me along with this?

Best Regards!
rockfiles.nl 110% rock radio!!
the no.1 rock & metal station!!
User avatar
radio42
Site Admin
Posts: 8321
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Album cover on website

Post by radio42 »

The above macros can be used with any control-command.
As said above...
E.g. via the following control-commands:
- EXEC_SEND_HTTP_GET
- EXEC_SEND_HTTP_POST
- EXEC_WRITE_PLAYLISTFILE (see here for details http://www.proppfrexx.radio42.com/myBB/ ... php?tid=72)

And as said above, these macros are resolved to a Base64 encoded string containing the binary image data of a Jpeg image.
This means:
- ProppFrexx reads any existing track image
- converts that to a Jpeg image of size 200x200
- uses that converted image and used a standard base64 encoder to convert that to a string

As a result the macro will resolve to a base64 encoded string containing the raw image data!

On your web-site (when receiving/reading that base64 image string) you must:
- decode that received string back to binary data (e.g. via the PHP 'base64_decode' function)
- use that decoded binary data to create the image on your web-site
- use the 'image/jpeg' mime type for that!

So I am not sure what info you are actually missing.
atlantic
Posts: 82
Joined: 09 Apr 2012 18:35
Location: Belgium
Contact:
Re: Album cover on website

Post by atlantic »

Maybe this will help you.

<?php
echo "<img src=data:image/jpg;base64,${currentalbumart} width='200' height='200' border='0' title='${currenttrackname}' >";
?>
User avatar
rockdj
Posts: 23
Joined: 25 Feb 2013 16:44
Re: Album cover on website

Post by rockdj »

Thanks for your answer! What I actually need to know is where excactly in PF do I fill in these commands.. I know that it's needs to be doen in de event/command section. But what are my next actions then?
Maybe someone could help me out with this..
rockfiles.nl 110% rock radio!!
the no.1 rock & metal station!!
User avatar
rockdj
Posts: 23
Joined: 25 Feb 2013 16:44
Re: Album cover on website

Post by rockdj »

Thank you Bernd,

But when I'm there, what's my next action?
I put an attachment with this message, so you can see my current situation.
Attachments
command builder.jpg
command builder.jpg (68.65 KiB) Viewed 11830 times
rockfiles.nl 110% rock radio!!
the no.1 rock & metal station!!
User avatar
radio42
Site Admin
Posts: 8321
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Album cover on website

Post by radio42 »

Not sure what more you are looking for.
When you placed those two commands e.g. with the "Streaming.OnSongTitleChanged" event and they are working fine...then you might have a file called 'test.html' on your web-site?
Is that working?
If not, what happens, if you open the file C:\Test\test.html locally within your internet browser?

Post Reply