[Icecast] get current song
"Thomas B. Rücker"
thomas at ruecker.fi
Mon Feb 3 14:51:17 UTC 2014
On 02/03/2014 01:12 PM, SK wrote:
>> I'd try out browser playback. Works very well for ogg/vorbis and should
>> also start working for opus streams on most browsers now.
>> There is a javascript api to get metadata.
> Thank you. I will try.
> Can you point me to that "javascript api to get metadata" -- I have no idea
> where to start.
Here's an example that I whipped up some time ago:
http://www.ruecker.fi/foss/icecast/firefox/metadata.html
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement
Seems it's Mozilla only at the moment though. :-/
Also didn't verify if it picks up metadata at intake or when playing.
Cheers
Thomas
>
> CK
>
> On Mon, Feb 3, 2014 at 2:50 PM, "Thomas B. Rücker" <thomas at ruecker.fi> wrote:
>> On 02/03/2014 09:38 AM, SK wrote:
>>> Hi,
>>> I use dynamic playlist, so do not have static list of files. I sream
>>> this play list on my mage via simple flash player,
>>> and show this playlist in this page with ajax-ed javascript.
>>>
>>> Here is question.
>>>
>>> I need to get current song,
>>> but when I ask icecast server I get wrong information. Sometimes song
>>> is still playing,
>>> but info from server is updated to next track.
>> The info is absolutely correct from the server point of view. At that
>> point in time the server is already sending the next song to clients.
>> Why you hear something different is because your listening client has a
>> significantly sized cache to avoid buffer underruns (which is mostly a
>> good thing).
>>
>>> I have many short
>>> (3-5-10 seconds) tracks in my play list,
>>> so this difference is critical for me.
>>>
>>> What can I do with it?
>> Then polling the server for current playing song is unsuitable for you.
>> You'll have to find a player that reads the metadata from the stream AND
>> does it in sync with the buffer. If it doesn't do the latter, you'll
>> still face the same problem.
>>
>> I'd try out browser playback. Works very well for ogg/vorbis and should
>> also start working for opus streams on most browsers now.
>> There is a javascript api to get metadata.
>>
>> Please note, that just adding 'delay' to presenting metadata is NOT a
>> viable solution, as the buffer size may differ and also clients fall
>> behind differently and there might commonly be a delay of anywhere from
>> 2 to 60s.
>>
>> Cheers
>>
>> Thomas
>>
>> _______________________________________________
>> Icecast mailing list
>> Icecast at xiph.org
>> http://lists.xiph.org/mailman/listinfo/icecast
> _______________________________________________
> Icecast mailing list
> Icecast at xiph.org
> http://lists.xiph.org/mailman/listinfo/icecast
>
More information about the Icecast
mailing list