clappr-markers-plugin icon indicating copy to clipboard operation
clappr-markers-plugin copied to clipboard

Get stream metadata

Open ChoiZ opened this issue 9 years ago • 9 comments

Nice job, nice plugin!

Maybe it can be cool if you get the stream metadatas.

ChoiZ avatar Dec 13 '15 21:12 ChoiZ

Thanks!

What metadata are you referring to?

tjenkinson avatar Dec 14 '15 11:12 tjenkinson

Stream title for audio streams like icecast / shoutcast streams or MP3 streaming (id3tags). Here my audio stream test: http://51.255.51.220/reggae/ I want to display stream title for each track in my playlist.

ChoiZ avatar Dec 14 '15 21:12 ChoiZ

That sounds cool, and I think would work well as a separate clappr plugin. That plugin would then also add this plugin and get a reference to it internally to control it.

I just looked through some of the .m3u8 files for your stream and didn't see any track titles in them. Are you currently embedding titles in the stream?

tjenkinson avatar Dec 15 '15 17:12 tjenkinson

In the first m3u8 you've got:

  • one m3u8 for 96kbps (inside you've got some ".ts" files who contains audio stream @ 96kbps)
  • one m3u8 for 64kbps (inside you've got some ".ts" files who contains audio stream @ 64kbps)
  • one m3u8 for 32kbps (inside you've got some ".ts" files who contains audio stream @ 32kbps)

I think you've got the metadata in ".ts" file but I don't find yet how to get the datas ;-)

By the way do you know if it's possible with your plugin to create new marker with time instead of stream position?

Currently:

  new ClapprMarkersPlugin.StandardMarker(0, "The beginning!"),
  new ClapprMarkersPlugin.StandardMarker(90, "Something interesting."),
  new ClapprMarkersPlugin.StandardMarker(450, "The conclusion.")

With the time:

  new ClapprMarkersPlugin.StandardMarker(11:32:21, "The beginning!"),
  new ClapprMarkersPlugin.StandardMarker(11:35:18, "Something interesting."),
  new ClapprMarkersPlugin.StandardMarker(11:50:00, "The conclusion.")

ChoiZ avatar Dec 15 '15 18:12 ChoiZ

No you will need to build a function to convert the time from that format into seconds.

This might do what you want.

tjenkinson avatar Dec 17 '15 13:12 tjenkinson

So the time in your maker is in seconds?

So if I create a new StandardMarker(1, "marker one"); I have to do that:

get current time - playlist lenght in seconds + my point position

ie: Current time : 12:05:00 Playlist length: 5mn My marker: 1sec 12:05:00 - 5mn + 1 sec => 12:00:01

I'm right? (I know how to do that in Javascript thank you ;))

ChoiZ avatar Dec 17 '15 21:12 ChoiZ

It's in seconds from the start of the media so yes you'll need to calculate what time 0 represents in real world time first and then go to (seekTime - zeroPointTime) where seekTime and zeroPointTime are both times represented as seconds (eg UNIX timestamp).

If your stream is a sliding window the 0 point will be constantly changing so you'll need to keep updating the markers times on the clappr TIME_UPDATE event.

tjenkinson avatar Dec 19 '15 10:12 tjenkinson

Ok thank you for all this informations ;)

ChoiZ avatar Dec 19 '15 19:12 ChoiZ

No problem let me know how it goes or if there are any issues :)

tjenkinson avatar Dec 19 '15 22:12 tjenkinson