Song Displayer : plugin WordPress pour afficher ce que joue Winamp ou SAM Broadcaster

Song Displayer est un plugin pour WordPress qui affiche les informations des fichiers joués par Winamp ou SAM Broadcaster sur votre blog.

Principe

Le plugin lit la playlist générée par Winamp et en extrait les informations pour afficher les données des tags ID3v1 des fichiers de votre playlist.

Si la playlist n’a pas été mise à jour depuis un certain temps, le plugin considère que Winamp est éteint. Si les tags ID3 sont incomplets ou manquants, le plugin affichera le nom de vos fichiers.

Par défaut, le nom de l’artiste et le titre de la chanson apparaissent ainsi que le titre de l’album s’il est disponible (tag ID3). Vous avez aussi la possibilité de faire un lien de ces informations vers votre radio Shoutcast ou IceCast afin de faire partager ce que vous écoutez avec d’autres.

Il y a 4 fichiers :

mp3-in.php est le modèle de génération de playlist pour Winamp.

mp3-in-sam.php est le modèle de génération de playlist pour SAM Broadcaster.

mp3-out.php est la playlist générée avec les tags ID3. C’est ce fichier qui sera uploadé sur votre serveur.

song_displayer.php est le plugin à mettre dans le répertoire wp-contents/plugins de votre blog WordPress.

Version actuelle : 0.4

Téléchargement

https://www.skyminds.net/?download=song_displayer

Guide d’installation pour Winamp

Il faut tout d’abord se procurer le plugin DoSomething pour Winamp.

Une fois installé, allez dans Winamp > Préférences > Plugins > General Purpose > DoSomething et cliquez sur “Configure”.

Pour commencer, décochez la case “Disable Plugin” afin d’activer le plugin.

Création de la playlist

Dans le menu déroulant, sélectionnez “Generate HTML Playlist“.

Dans “Template In“, rentrez le chemin du fichier mp3-in.php sur votre disque.

Faîtes de même pour “Template Out” avec le fichier mp3-out.php.

Cliquez sur Update pour valider les changements :

Generate Playlist
Création de la playlist

Envoi de la playlist sur le serveur via FTP

Une fois la playlist générée, il faut l’uploader sur votre serveur.

Pour cela, il nous faut ajouter le service “FTP a file” dans le menu déroulant et remplir les informations en suivant l’example ci-dessous :

FTP Playlist
Envoi de la playlist sur le serveur via FTP

Guide d’installation pour SAM Broadcaster

L’installation sous SAM est très simple.

Copiez mp3-in-sam.php et mp3-out.php sous /Program Files/SpacialAudio/SAMBC/samHTMweb/.

Allez dans File > Config > HTML Output et ajoutez une nouvelle règle de génération de playlist. Utilisez mp3-in-sam.php comme input file et mp3-out.php comme output file.

Cochez Auto-upload generated file via FTP et configurez votre accès FTP. Et voilà!

Voici une capture d’écran de la configuration sous SAM :

sam song displayer

Configuration du plugin

Upload du plugin sur le blog

Il vous reste à uploader le fichier song_displayer.php dans le répertoire /wp-content/plugins de votre blog. Chmodez-le en 666 pour pouvoir le modifier en ligne avec WordPress.

Le plugin possède 3 options : l’URL de la playlist (mp3-out.php) depuis l’index de votre blog, le délai en secondes avant de considérer que Winamp est éteint (7 minutes par défaut, à vous de changer selon la longueur de vos chansons) et le l’URL de votre flux Shoutcast ou IceCast si vous en possédez un.

Intégration des données

Dernière étape : intégrer les informations à la template de votre blog. Pour cela il suffit d’afficher le tag suivant dans le fichier sidebar.php là où vous voulez que cela apparaisse :

if(function_exists('show_playlist')) { show_playlist(1, " - ", ""); }

Paramètres de la fonction

1er paramètre : nombre de lignes à afficher. Par défaut : 1 (chanson actuelle).

2ème paramètre : séparateur entre le nom de l’artiste et le titre de la chanson.

3ème paramètre : séparateur utilisé pour les lignes multiples. Par défaut : vide. Sinon ajoutez un saut de ligne.

Envie d'ajouter des fonctionnalités exceptionnelles à votre site WordPress ou WooCommerce? Je suis là pour vous aider.

Explorons les possibilités ensemble »

Articles conseillés :

43 pensées sur “Song Displayer : plugin WordPress pour afficher ce que joue Winamp ou SAM Broadcaster”

  1. I don’t if I should email you instead or what, but I can’t seem to get this plug-in to work properly. I installed it and configured the Do Something plugin. Every time the song changes, a WinAmp window pops up that says that’s there’s an FTP upload in progress. So I am assuming that I did everything right. However, it won’t show up on my site.

    I am running WinAmp 5.05, Do Something 2.12, and WordPress 1.5, if that’s any help. I activated the plugin, CHMODed the files to 666…

    Can you help me? :)

    Reply
  2. Erm, nevermind :D I didn’t realize that I’d have to change anything in the song_displayer.php file :P

    Thanks for a great plugin! :)

    Reply
  3. Hello Allie :)

    Sorry for taking so long to reply, I was out in the country for the weekend :p
    Yes there are a few variables that need editing within the script, I plan to make an option page in the next version. Take care, hope you can go to London anytime soon, this city really rocks ! ^_^

    Reply
  4. I’ve been trying to get this to work but nothing is coming up.

    Finally I decided to take out the tag and put a blank line but then nothing showed up.

    I edited the details as mentioned and still nothing. Originally I had “/public_html/*whatever*/mp3-out.php” but nothing happened. I changed it to “http://blogaddress.com/path_to_plugins/mp3.out.php” and still nothing.

    I thought it may have to do with the file and I checked it but it’s updating properly.

    Any ideas?

    Reply
  5. Hello Darien,

    You need to leave the space otherwise it will not work : all the arguments are compulsory for the function to work out properly.

    Also check that the plugin can access mp3-out.php – here’s my setting :
    $playlist = “/home/CPANEL_NAME/public_html/FOLDER/mp3-out.php”;

    Tell me how it works out :-)

    Reply
  6. For some odd reason, I can’t seem to get it to work correctly. It’s FTPing correctly and such, but otherwise it is not working correctly. It says radio is offline. Please help.

    Reply
  7. Aeon : have you edited the $delay value ? By default, if the last file update is superior than 7 minutes, the script considers that the radio is not playing : you may have to increase that value if you play some Pink Floyd for instance as the songs play longer. Do you get errors ? Which WordPress version are you running ?

    Reply
  8. I’m using WordPress 1.5, and I’m not recieving any errors, it just says my radio is down, while I’m playing something in WinAmp, might I need to CHMOD any of the files for usage?

    Edit : Oh, I figured it out, I didn’t CHMOD the files correctly, it works perfectly, and thanks for such a great and wonderful plugin.

    Reply
  9. Matt,

    I was initially writing to ask for help/support getting this working, but I got it. Thanks for a cool plugin :]

    Reply
  10. Hi, I use this plugin, and it seems to work fine except one thing:

    I have to set the delay value to: 999999999 or it always says ‘radio is off’
    if i set it to 7 seconds it always says radio is off, but when i set it to 999999999 it NEVER says ‘radio is off’, even when it is! It just shows the last song i listened to, even if it was days or even weeks ago.
    can you please help?
    thanks!

    Reply
  11. Hello Paul, I have set the delay value to 480 (8 minutes) on this blog : if the text file hasn’t been updated within the delay, then Winamp’s considered turned off. I suggest you reduce your value to something like 480 or 600 – that should fix your issue :)

    Reply
  12. i’ve tried that, even if i set the delay to 99999999 instead of 999999999 it will always say “radio is off.”
    i asked around on the wp forums, and another person said they had the same issue, and we both use linux servers.
    it’s not killing me or anything, just wondered if there was a way to resolve it. either way, i think you’ve made a great plugin!

    also, would there be a way to make a list of lets say the last 5 songs played?
    that would be sweet. thanks again!

    Reply
  13. Paul, what happens if you set the value to 420 ? A very high value will tell the script that the radio is playing forever. You need to reduce it as it is expressed in seconds.
    To display the last 5 songs played :
    * edit the mp3-in.php file and repeat 5 times the line that’s already there.
    * edit the function that you placed in your template, like this :

    "); ?>

    The first argument (“5”) tells the script how many lines it should display, the second one (“-“) breaks the artist name and the song name while the third one is used to break lines.

    Reply
  14. Okay, maybe I’m a moron, but i can’t get this working, mostly because I don’t speak French. =] It seems to be uploading the file correctly, I just don’t get where (how?) we’re supposed to update “sidebar.php”. Any help would be appreciated!

    Reply
  15. Hi Jeremy,

    My bad – I should have updated this page a while ago ;-)
    If you use WordPress v1.5+, you’ll have to edit the sidebar.php file of your theme, which can be found in your /wp-content/themes directory. Once in there, add this tag where you want the text to be displayed :

    "); ?>

    Also make sure you edit the plugin to reflect your settings :)

    Reply
  16. i did some modifications and it works
    – deleted song_displayer.php
    – set on mp3-in.php %%CURRENTARTIST%% – %%CURRENTSONG%%
    – put on my theme include(‘mp3-out.php’);

    et voila!

    Reply
  17. I love this plugin but I cannot get it to ftp to my server, however if I ftp wp3-out.php manually through my ftp program the song playing shows up. Please let me know if you have any ideas why this is happening? Thanks!

    Reply
  18. Kristina, make sure that you entered your FTP information correctly : the login may be a full email address with your domain name and not simply a username. Verify your password as well – if you can FTP the file manually with a FTP client, the plugin can do the same automatically with the same info :)

    Reply
  19. Thanks Matt :) I got the mp3-out.php file to ftp to the correct directory!!! BUT it won’t update to display the song on my page, it just says Radio is off :( So do I put the same remote path that I used in the plugin Do Something in song-displyer.php file too? I have been using babelfish to translate this page from french to english so I guess I am missing something somewhere?

    Reply
  20. Hello Kristina :)

    Okay the FTP thingy is working so now you have to edit the options in song_displayer.php so that they reflect your webserver configuration. In particular, have a look at :
    – $playlist, whose path directs to mp3-out.php (e.g. “/home/CPANEL_USERNAME/public_html/FOLDER/mp3-out.php”)
    – $delay, which assumes Winamp is turned off if the file hasn’t been modified within that delay.

    Don’t hesitate to shoot me an email if you’re stuck :)

    Reply
  21. Hi Matt:

    I’ve installed the plugin for Winamp and WP. The FTP Transfer to my Homepage works but the plugin shows “Radio off”.

    My mp3-out.php file is on )

    Now, I’m a little bit confused about about the right path to acces this file. When I open my account with a ftp programm, I have 3 folder (pics, hpimg; www)

    My string is: $playlist = “/mp3-out.php”;

    So what is wrong with my configuartion?

    Thanx for your help!

    Ronny

    Reply
  22. Hello Ronny, the path must be wrong, try using these combinations :
    – “/www/mp3-out.php”
    – “/home/*your_cpanel_name*/public_html/mp3-out.php”
    – “/home/*your_cpanel_name*/www/mp3-out.php”

    These are the most frequently used. If it still not right, have a look at the path stored in WP admin Panel > Options > Miscellaneous > Uploads. This should help :)

    Reply
  23. What part from index.php should I use on my index.html or index.php to display the song? I want to use it on my personal website not on the wordpres.
    thanks

    Reply
  24. Hi, I’m having a problem installing the plugin. It has never said anything except “Radio is off!” I have my mp3-in.php located at C:webrootradiomp3-in.php. The same for mp3-out.php. I have mp3-out.php located in the following place on my site: . The permissions are set to 777. I have even tried manually uploading. I know my FTP is correct because I created a special account and password for winamp. Thanks for your help (hopefully!)

    Reply
  25. Hello :)

    Jonathan : to display the song info, add this to your page file :

    "); ?>

    Alisha : did you edit the plugin file (song_displayer.php) so that it can pick the playlist file. Have a look at the $playlist value.

    Reply
  26. yes, I had been doing that, but all of a sudden (like when you go back to a crossword and find right away the word you had previously spent an hour looking for) I thought to check if my mp3-out.php file was being updated from my player. In fact, it hadn’t updated this time, but I noticed it had updated from a previous attempt, so I finally figured out what that was. After I saw that it had updated, I rechecked the $playlist. I don’t know what I was thinking before, but it clearly states in the directions (thank you!) that I need to enter the path FROM my BLOG ROOT. Since the file was under my blog root directly, I needed nothing more than the name of the file itself! Long story short: I was making it too complicated AND I wasn’t following a logical process of elimination. Thanks for a great plugin.

    I have one more question though: How does it transmit special characters? Do you have any problems with ñ or ç showing up or is it just my site?

    Thanks

    Reply
  27. Hi Alisha :)

    Cool to see you’re sorted ! I have no problems with special characters because I use the “iso-8859-15” encoding option for all my pages instead of UTF-8 (under WP Admin > Options > Reading). You can try to see if that helps but it may mess up your previous posts…

    Reply
  28. Hello Matt,

    J’ai développé mon site sous Joomla (www.zevox.fr). J’avais hésité entre Drupal, Joomla et WordPress. J’ai choisi joomla pour tout l’aspect collaboratif sympa qu’il présente.
    Si j’utilise ta solution, j’ai donc à développer le plugin pour Joomla : Sais-tu ce que cela implique comme changements entre un plugin WordPress et un plugin joomla?

    Par ailleurs, il me semble que tu as sorti une nouvelle version de songdisplayer. Peux-tu m’en communiquer les sources?
    Merci
    Fabrice de ZeVox

    Reply
  29. Salut Fabrice,

    Tu n’as pas vraiment besoin de développer une version pour Joomla : le plugin ne contient qu’une fonction qu’il faut appeler dans ta page. J’en ai fait un plugin WordPress mais c’est utilisable sur n’importe quelle page web, sous n’importe quelle plateforme. Il suffit :
    1- d’inclure le plugin :

    2- de lancer la fonction là où tu veux que les infos apparaissent:

    Qu’est-ce que tu entends par “les sources” ? Tu peux télécharger le script ici.

    Reply
    • Salut,

      le Plugin semble vraiment tres interessant puisque je cherche un truc pareil depuis pour ma webradio.
      1. en effet je ne suis pas sur de comprendre le parametrage du ftp. Dois-je avoir un serveur ftp? que dois-je exactement entrer dans FTP Host, Username et Password. bref d’où viennet ces données?
      2. Ma page web est juste programée en html. puis-je mettre cette ligne de commande php dans mon code html si bien qu’elle fonctionne comme elle le devrait?

      merci bien

      Reply
      • Salut,

        1- pour le FTP, si ta page est hébergée sur un serveur distant (free.fr ou autre), tu la mets à jour avec un client FTP. Il suffit de rentrer les identifiants du serveur (FTP host est l’adresse du serveur FTP).

        2- pour exécuter le code PHP, il suffit que ta page HTML porte l’extension .php (et que ton serveur ait PHP activé, ce qui est généralement le cas).

  30. Bonjour Matt,

    Depuis quelque temps je m’étais concentré sur d’autres aspects du site que je développe et maintenant je reviens à la nécessité d’afficher les infos du morceau joué (artiste, titre) sur le site.
    je développe en JOOMLA et pour créer un plugin joomla, il faut au minimum un fichier avec l’extension .php et un fichier avec l’extension .xml.
    On met ces deux fichiers dans un répertoire, on zippe ce répertoire et il ainsi prêt à être téléchargé à partir de l’interface d’administration de JOOMLA.
    J’ai donc essayé d’adapter ton fichier .php pour faire un plugin selon les divers tutoriels que j’ai pu trouver sur le net.
    Mais cela ne marche pas. Je sais bien que tu développes sur WordPress, mais par rapport à ton expérience sur SAM BROADCASTER et aux contacts que tu pourrais avoir par ailleurs, peut-être, me suis-je dit, que tu pourrais avoir des précisions quant à l’adaptation spécifique pour JOOMLA.

    J’ai mis un post sur le forum de JOOMLA, mais aucune réponse. je vais relancer… Je n’arrive pas à croire que personne ne développe de webradio sur JOOMLA…

    Au plaisir si tu as des infos complémentaires…

    Fabrice

    Reply
    • Bonjour Fabrice,

      Je n’ai pas vraiment d’expérience avec Joomla, j’ai regardé le site d’un client qui avait cette plateforme et j’avais trouvé cela bien confus au niveau de l’administration (c’était une vieille version 1.0.x donc ça a sûrement évolué).

      Que contient le fichier XML ? Si ça se trouve, c’est tout simple.

      Reply
      • Hello Matt,
        Je souhaiterais t’envoyer le package plugin pour JOOMLA (fichier zip contenant song_displayer.php adapté pour JOOMLA et song_displayer.xml)
        Comment puis-je te l’envoyer?

        Fabrice

Opinions