How can I get and show meta information (station name, current song, bitrate, etc.) when playing a radio stream with HTML5 audio?
How can I get the current song title, radio station name and other meta information from a radio stream played using Html5?
<script>
$(document).ready(function(){
AudCurs=new Audio();
$('#play').click(function(){
AudCurs.setAttribute('src','http://62.27.26.45:8000/klassikradio128/livestream.mp3');
AudCurs.play();
});
});
</script>
<button id='play' >Play</button>
thanks for the help
+3
source to share
1 answer
According to the HTML5 and Mozilla standard, there isn't much detail you can get [ 1 , 2 , 3 ].
You can get the sample rate:
var rate = AudCurs.playbackRate;
Your stream probably supports ID3 tags. In this case, you can get more information: http://ericbidelman.tumblr.com/post/8343485440/reading-mp3-id3-tags-in-javascript
For more details, I would recommend that you implement this on the server side and then get the results using AJAX and JQuery.
+1
source to share