How is possible to display streaming title and artist metadata from shoutcast streaming in JWPlayer? Is there any way to display this on player screen and to be updated in real time?
You can undelete the print line in *shoutcast_song_title.php* and call it in your browser to see the full array of data available, adjust the array element to match the element that has your song title (currently [12]).
More thoroughly tested with the v4.2.x player (that means my mistakes are fixed :D).bc.. <!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
This application was written for Shoutcast/Icecast servers which have the data (Title, Users, etc.) available in a serverside application.
For RTMP, or any other method of serving media files, there would have to be a serverside application that supplied the data. If you were serving a continuous stream of media (songs, video, etc.), the application that queued up the media could provide that data, then the client just requests the data every 30 seconds or whatever is appropriate for the application.
There is not another solution to dislay on JWPlayer as a capture text or as subtitle? Or is not another solution to get the Title and Artist from /7.html file not from XML (for xml is required admin password on shoutcast).
Is there any another solution non php (flash or to be integrated on jwplayer)?
On Wowza server i found a player and for metadata information from SHOUTcast server use this AS (Maybe the developer do something in this way and include this for future version):
I didn't say is not help me your code, but i'm looking for a flash solution not ajax java or php tricks. I'm not flash as programmer from that reason i ask here for a solution.
Hey, I can't get this working. Dunno why i placed all files in the right place (shoutcast_class.php , shoutcast_song_title.php and Shoutcast Song Title.html )
It's display this instead of displaying the song name bc.. getServerInfo($display_array); //print "
Check that you have the full file *shoutcast_song_title.php* on your server and call it with your browser *http://www.mydomain.com/path/shoutcast_song_title.php* to see any error messages.
Hmm what are you referring when you say server. It's my domain server right ? Let's say i don't have a website, domain etc ; I tested locally by opening shoutcast_song_title.php with firefox and the error is error that i posted in previous post It's impossible to not having the full file, look here : http://petrikx.ampaste.net/f10875068 (the code of shoutcast_song_title.php )
The PHP scripts are intended to be executed on a server that supports PHP. I suppose they could be executed locally with the PHP interpreter, but i don't know what the result would be.
Install a simple server that supports PHP on your local machine, then you can call the script from it. LightTPD is a simple one-click install, then you can serve HTML, execute PHP, and stream MP4 and FLV.
well i just tested shoutcast_song_title.php on a real server ( i mean on a website) and yeah it's working :p About Shoutcast Song Title.html, is the complete script ? i mean are not missing some flashes ?
*Shoutcast Song Title.html* is a complete page. If you are using a v4.x player, you can remove the v3.x player code, which is commented out. You can add any v4.x player supported flashvars to futher customize the *JW FLV Media Player*.
Is there a way to skin the player? I've tried a few different methods of applying a skin, but it breaks :( I followed the directions on how to apply a skin to flashvars, but it doesn't seem to apply to this.
kLink thanks for this perfect code. I did some changes on it, by adding the Artist/Song Name, station status and radio station name. You can add everything just following my changes.
*Index.html* bc.. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<div id="title" class="title"> Title </div> <div id="playercontainer" class="playercontainer"> <a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a> </div>
You don't need to use AJAX to load a JavaScript file. That's why I wrote the code to use JS.
A "Live" update is only as live as you check the server (every 30 seconds or whatever) to see if the file has been updated.
If you check the shout-stream code, you will see a default interval of 1000ms (once per second), which is too often for a Shoutcast stream. Once per 30 seconds is probably often enough.bc.. else { $ss_interval = (intval($ss_interval) * 1000); }
So the code that you have is doing the same thing; checking the stats every [interval] and updating the display on the client.
I can't make a Joomla module without installing, configuring, and learning the quirks & glitches of Joomla. *_And... that ain't gonna happen in this century. :D_*
I've completed the Joomla module for this. It comes with a Readme.txt on how to connect it to your Shoutcast Server. If you would like a copy, please email me at:
Make a directory structure like this:bc.. http://www.mydomain.com/player/ http://www.mydomain.com/images/ http://www.mydomain.com/media/ http://www.mydomain.com/scripts/
Put the player components, player.swf, swfobject.js, skin(s).swf in the player directory.
Put the media files, video.flv, music.mp3, in the media directory.
Put the script in the script directory.
Put your images in the image directory.
www.mydomain.com is a generic name for your domain.
video.flv and music.mp3 are generic names for your video and music files.
Ajax and PHP script it's not a good solution when you have online 500 listeners and use JWPlayer player and this script. The server become overused, each listener = Apache load, and when title and artist it's reload at 500 listeners, mean 500 calls on apache server. This is the reason why i'm looking for Flash solution to display Artist and Title, also i post another ticket regarding this problem, a solution can be small modification on RTMPmodel.as, i got a part from Wowza SHOUTcast Player (witch is free open source player) and what do that:
On Wowza forum i got this details:
bc.. Metadata on JW Player for streaming is handled in the com.jeroenwijering.models.RTMPModel file.
Look at the onData Function.
Code:
public function onData(dat:Object):void { //if(dat.type == 'metadata' && !metadata) { if(dat.type == 'metadata') { ....
Put a break or some trace statements here and you should see the shoutCast metadata.
Richard
Maybe somebody will do something in this way, personal i paid JWPlayer, i'm not using free version and i really don't understand why people from here, guys who develop JWPlayer are not interested to add this feature in this player. If was only a static player for Video and Audio files on demand i understand, but also have support for live streaming contect... so ....
It's not abut traffic, that it's zero, it's about how many resources eat when you have 500 listeners, each listener with that script mean a apache process on server. Belive me, i try and i know what i mean, it's great script, but when you have less listeners on that player.
Thanks lefTy for your replays, but we are going in Loop.
From Nov. 09, 2008 when i open this topic, i wait to see if somebody is able to do something on this player to get automated title and artist frm SHOUTcast streaming server, it's nothing special, just this features add, as have subtitle option and others, but maybe developers are not interested in this, he know better that me the code of this player. Anything i try i don't get a answer on my questions just additional tricks. i'm ready to pay if someone is able to do this, i don't ask for free, as i paid licence for this player, i want to use at what i need, to play streaming from shoutcast and also if is possible to display that stupid Title and Artist, nothing impossible.
But I like going round & round & round in circles it's fun! :D
I think you are misusing your server, but that's your problem, not mine.
If it's a Flash programmer that you are looking for, you are posting in the wrong place.
Try one of the Flash sites or maybe Jimb, who seems to be a capable Flash programmer, could be persuaded to do the Title/Artist thingy for you. His contact information is in this thread: *http://www.longtailvideo.com/support/forum/General-Chat/16621/A-few-simple-player-modifications#msg113046*
After long time of research, i found one solution, is not complete but working. The solution is to use *"metaviewer"* is you take the stream from SHOUTcast Server in Wowza, display song title and URL, but nothing more.
Now the question is, why doesn't support if you play in JW Player direct from SHOUTcast server? Can be this plugin modify to display that info also from SHUTcast direct not only if you Flash server??
Here is the *metaviewer* source: http://developer.longtailvideo.com/trac/browser/plugins/metaviewer
Anyone interested in using JW Player Flash Shoutcast Player for Joomla. I have made this into an installable Joomla 1.5 Module. Download below and read the enclosed Readme.txt:
I can't seem to get this to work. I've spent hours going over different ways of compiling it all and I think I'm close.
The songs play perfectly, and the title is trying to populate inside the player, but I literally get the title for each song being the letter "i" or "e" or "n" depending on which data_array number I select ( $data_array[5] ) in the shoutcast_song_title.php, *whether it's actually streaming or not...*
So, to recap: When I pull up http://mysite.com/pathto/shoutcast_song_title.php I get this:
bc.. document.getElementById("title").innerHTML = "Radio Station:: o Status:: c Artist/Song Name:: i";
Any idea what could be causing this? Thank you in advance for any help!
* shoutcast.html* bc.. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<div id="title" class="title"> Title </div> <div id="playercontainer" class="playercontainer"> <a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a> </div>
bc.. <?php /****** * You may use and/or modify this script as long as you: * 1. Keep my name & webpage mentioned * 2. Don't use it for commercial purposes * * If you want to use this script without complying to the rules above, please contact me first at: marty@excudo.net * * Author: Martijn Korse * Website: http://devshed.excudo.net * * Date: 08-05-2006 ***/
/** * version 2.1 */ class Radio { var $fields = array(); var $fieldsDefaults = array("Server Status", "Stream Status", "Listener Peak", "Average Listen Time", "Stream Title", "Content Type", "Stream Genre", "Stream URL", "Current Song"); var $very_first_str; var $domain, $port, $path; var $errno, $errstr; var $trackLists = array(); var $isShoutcast; var $nonShoutcastData = array( "Server Status" => "n/a", "Stream Status" => "n/a", "Listener Peak" => "n/a", "Average Listen Time" => "n/a", "Stream Title" => "n/a", "Content Type" => "n/a", "Stream Genre" => "n/a", "Stream URL" => "n/a", "Stream AIM" => "n/a", "Stream IRC" => "n/a", "Current Song" => "n/a" ); var $altServer = False; var $inputEncoding, $outputEncoding, $streamEncoding;
Call the script from your browser:bc.. http://www.domain.com/path/shoutcast_song_title.php
You should get the array of available data from the mount point that looks like this:bc.. Array ( [0]=>BootLiquor:AmericanarootsmusicforCowhands,CowpokesandCowtippers.[SomaFM] [1]=>AltCountryAmericana [2]=>http://www.somafm.com [3]=>ArthurGodfrey-HelloInThere [4]=>Serveriscurrentlyupandpublic. [5]=>Streamisupat128kbpswith152of300listeners(150unique) [6]=>300 [7]=>19h37m34s [8]=>BootLiquor:AmericanarootsmusicforCowhands,CowpokesandCowtippers.[SomaFM] [9]=>audio/mpeg [10]=>AltCountryAmericana [11]=>http://www.somafm.com [12]=>ArthurGodfrey-HelloInThere )
It's the same page of data that you get if you go to the mount point with your browser:bc.. http://207.200.96.230:8014/
Thank you so much for your fast reply, I really appreciate it. Okay so I think we might be seeing part of the problem here. When I call that page directly (while streaming) I get this: Connection timed out (110)
Okay well I have implemented your code including your version of the player.swf and I'm running into the same problems.
We've eliminated the code being a problem, and my winamp, and we've eliminated my server being the problem *I think* (because *you* can pull in the correct title and song from my stream). Wow I can't believe it but I'm actually confused as how to troubleshoot further LOL
So I thought about mounting your IP address essentially like you did with my radio and you were able to pull in my song title and song. However, when I do that with your IP address and port, your song streams but the title doesn't show up. It's still putting an "i" in place of the title.
Could it be my computer? I've even changed the port to 8014 and it's not working. I think the whole connection timed out could help elude to the root of the problem. Have you had any experience with that type of error in this situation?
What's weird is it's putting out the song information and history here --> *http://208.90.177.154:8014/index.html* so why is my script not able to pull that information that's obviously being generated?
It seems to me that only when we visit it on your server then it works. Because if you were to visit this address: *http://jennyandjeramiah.com/liveradio/beta/Shoutcast%20Song%20Title.html* then the title doesn't show up, and I think if you visited that address you would confirm that. It's just weird. Also if you visited: *http://jennyandjeramiah.com/liveradio/beta/shoutcast_song_title.php* that you would also see: *document.getElementById("title").innerHTML = "i";*
Can you confirm that? So I am starting to think that perhaps it is a server issue?
hmm, I'm done trying to figure this out. Since I've tested it on two separate servers independent of each other running different versions of php, I have to conclude it's a scripting issue at this point.
*IF *your experiencing the same issue I am, or looking for an *even better way* to bring in the info independent of the player, check out this awesome script which is affordable at 15 bucks which is a WINAMP plugin and will publish your song title and ALBUM ART with your song you're currently streaming on shoutcast to your website. Then just add the player below it!
When I try to open the file directly "shoutcast_song_title.php" sends me this error message "Connection timed out (110)" the player works perfectly but does not display the title information or anything, so try to open it and gave me this error, you can be?
How can I adapt this for a simple Icecast feed? I changed the URL's to /;live and got swfobject 2.2 and changed that in the script. But all I get is a black box that says Title and nothing.
It is so easy to update the title using PHP but it seems to take a 1000 lines of code to pull it out :)
The song title retrival works for my localhost perfectly! but when i upload them in the web server I always get only an "i" printed???
When i removed the comments on the "print "<pre>"; print_r($data_array); exit;" line I got "Connection timed out (110)" but even this works fine in my localhost!!!
We running a wowza server and stream title is in the rtmp stream. We have many clients (radio stations) the want to see the artist and title (refresh autom.) on the rtmp stream on flash a player (JWplayer). Nice scripts here but in wowza there is already the title info. Please check http://www.live-streams.nl/flash/ and see a flash example (title info refresh) i think a very nice extra for the JWplayer users and Wowza audio users! :-) I want to pay for it and give the simple .fla source to make it.
This post seems to be really useful, but I could not make it work. I may have some problem with the url. Currently I could not test it on a stream, could I test it on an existing .mp3? Where should I upload the .mp3 fie (in the same folder with the shoutcast_song_title.php, shoutcast_class.php, Shoutcast Song Title.html)? Which file should I open in the browser?shoutcast_song_title.php or Shoutcast Song Title.html? When I tried to open the Shoutcast Song Title.html file in the browser I become the message 'Get the Adobe Flash Player to see this video.', although I have installed the latest version of Flash player. What Am I doing wrong?
Dear tweedledum , Now it is not displayed the 'Get the Adobe Flash Player to see this video.' message in the browser. It is displayed just a text field with yellow foreground with 'Title' written in it. I do not see any player. I have written my plugins in as3, might should I do this in as3 too? Thank you very much in advance.
Hi! My plugin is from type Flash Plugin. And the stream is rtmp. Is there any possible way to display the title and the artist? I have seen something above bc.. /** Get metadata information from netstream class. **/ public function onData(dat:Object):void { if(dat.type == 'metadata') { if(dat.width) { video.width = dat.width; video.height = dat.height; } if(model.playlist[model.config['item']]['start'] > 0) { seek(model.playlist[model.config['item']]['start']); } } else if(dat.type == 'complete') { clearInterval(timeinterval); model.sendEvent(ModelEvent.STATE,{newstate:ModelStates.COMPLETED}); } else if(dat.type == 'fcsubscribe') { if(dat.code == "NetStream.Play.StreamNotFound" ) { stop(); model.sendEvent(ModelEvent.ERROR,{message:"Subscription failed: "+model.playlist[model.config['item']]['file']}); }else if(dat.code == "NetStream.Play.Start") { setStream(); } clearInterval(timeout); } model.sendEvent(ModelEvent.META,dat); };
But how can I use that in my case (to get title and artist)? Please help me. I am fully stuck. Thanks in advance