You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

mp3 metadata event Created Nov 14, 2009

This thread is solved

Views: 566     Replies: 7     Last reply Jan 11, 2010  
You must login first before you can use this feature

jaddle

Posts: 8

Registered:
Feb 6, 2008

mp3 metadata event

Posted: Nov 14, 2009

Is there any way that flowplayer can watch for updated metadata in an audio stream and fire an event? I have a live stream playing with tags that get updated periodically. When I watch the stream with mplayer, I see messages like "ICY Info: StreamTitle='blablabla';" whenever the update happens. I'd like to have flowplayer respond to these events, but I haven't found a way to do so.

There are a few cryptic references to an 'onID3' event scattered around the forums, but nothing in the documentation and I can't figure out any way to make that work...

Any suggestions?

jaddle

Posts: 8

Registered:
Feb 6, 2008

» mp3 metadata event

Posted: Dec 8, 2009

Reply to: mp3 metadata event, from jaddle
So I guess there's no way at all for flowplayer to listen for metadata changes? that's a real letdown.. anyone know any other flash player that can do this? or is it a limitation in the flash handling of audio streams?

blacktrash
underdogma: free videos at http://www.blacktrash.org/

Posts: 863

Registered:
May 27, 2008

» » mp3 metadata event

Posted: Dec 8, 2009

Reply to: » mp3 metadata event, from jaddle
I haven't tried it myself, but you could perhaps retrieve the clip's metaData object in regular intervals, and if the TIT2 property has changed, you trigger the action.

Something like:


var title = "dummy";
setInterval(function () {
  var currenttitle = $f().getClip().metaData.TIT2;
  if (currenttitle !== title) {
    title = currenttitle;
    // do stuff
  }
}, 1000);

Or perhaps just listening for a metaData change is enough for your purposes.

Have a look at this demo wrt metaData.

jaddle

Posts: 8

Registered:
Feb 6, 2008

» » » mp3 metadata event

Posted: Dec 10, 2009

Reply to: » » mp3 metadata event, from blacktrash
I tried that just now, and I just get '$f().getClip().metaData is undefined' errors. Looks like the metaData just isn't set at all for audio clips...

jaddle

Posts: 8

Registered:
Feb 6, 2008

» » » » mp3 metadata event

Posted: Dec 10, 2009

Reply to: » » » mp3 metadata event, from jaddle
I tried another test, just like the demo you linked to:

onStart: function(song) { alert.song.metaData.TIT2; }, metaData is still never defined...

perhaps this is because I'm not playing mp3 files, but mp3 *streams* (from an icecast2 server), so the metadata isn't really in an id3 tag attached to a file, but is embedded in the stream?

The metadata *is* being sent properly - when I listen using mplayer, I see the updates:

Starting playback...
A: 3.2 (03.2) of 0.0 (unknown) 0.3%
ICY Info: StreamTitle='1260478582';
A: 7.4 (07.3) of 0.0 (unknown) 0.3%
ICY Info: StreamTitle='1260478587';
A: 11.4 (11.4) of 0.0 (unknown) 0.3%
ICY Info: StreamTitle='1260478592';
A: 19.6 (19.6) of 0.0 (unknown) 0.3%
ICY Info: StreamTitle='1260478597';
A: 23.2 (23.2) of 0.0 (unknown) 0.3%
ICY Info: StreamTitle='1260478602';
A: 27.3 (27.3) of 0.0 (unknown) 0.3%
ICY Info: StreamTitle='1260478607';
A: 31.4 (31.3) of 0.0 (unknown) 0.3%

That 'StreamTitle' is what I'm hoping flowplayer can see.

jaddle

Posts: 8

Registered:
Feb 6, 2008

» » » » » mp3 metadata event

Posted: Dec 10, 2009

Reply to: » » » » mp3 metadata event, from jaddle
I'm having all kinds of trouble getting that demo to work properly, actually - I copied everything over to my server, updated a few of the URLs to point back at the ones on the server, and everything plays ok, except that onStart is never called! I can't figure it out - everything seems to be the same version on my server as on flowplayer.org. the code is unchanged except to add the server to the urls for the jpg and mp3, and directories added to the swf urls to point to where they are on my server. Why won't onStart fire?

I did all of this so that I could find out why I can't see the metadata, but I'm now finding that I can't even test it.. any ideas from anyone?

blacktrash
underdogma: free videos at http://www.blacktrash.org/

Posts: 863

Registered:
May 27, 2008

» » » » » » mp3 metadata event

Posted: Dec 10, 2009

Reply to: » » » » » mp3 metadata event, from jaddle
Yes, I made a few experiments to find out the following:

  1. The id3 tags must be version 2, not 1 for this to work.
  2. The id3 metadata retrieval is indeed not reliable, I sometimes also get "undefined" return values, or nothing with the onStart event.

You should file a bug about this to let the developers know.

jaddle

Posts: 8

Registered:
Feb 6, 2008

» » » » » » » mp3 metadata event

Posted: Jan 11, 2010

Reply to: » » » » » » mp3 metadata event, from blacktrash
I've done more research on this now:

first of all, there's no way flowplay can display the stream metadata, because it isn't requesting it from the server. I sniffed the packets with wireshark, and flowplayer never sets the 'Icy Metadata' header, so the metadata is never set.

I've seen conflicting messages about how feasible it is to get this metadata in flash at all - apparently, it's possible, but rather difficult. This comment explains a little bit what's necessary, in vague terms:http://www.flexiblefactory.co.uk/flexible/?p=51#comment-3556

Any chance of flowplayer ever supporting this? I rather doubt it. :( I wonder if there's any other way that I could sync the web page's javascript to the audio being played? Maybe I'll have to use java intead.. ick.