My PHP and Javascript knowledge are not 100% so I don't know the answer to this question.
I am trying to create a very simple radio player for a clients website. It only has to play a stream which he has a subscription to play his music from. I have achieved this pretty simply but getting the track name was a little more complicated.
I have found on Github a simple PHP function that lets you to extract the MP3 metadata (StreamTitle) from a streaming URL header response. So on page refresh, it happily dumps the track name out for me, but this obviously only works once.
I plan to use a bit of Javascript to return this function via an Ajax call and update the current playing track.
However if I would like this to change when the track does. I cannot at this time think of anyway to do this, except to keep looping this method every few seconds and updating the DOM.
What I don't know is, is this acceptable. Will the server suffer from continuously running an Ajax call every 5s or so and will the stream URL allow me to do this constantly.
I am assuming that it will be fine because the amount of data sent and received is very small.
I am a bit out of my depth here and it is a last ditch effort before I just create a link to radio stations external player.
Thanks
I am trying to create a very simple radio player for a clients website. It only has to play a stream which he has a subscription to play his music from. I have achieved this pretty simply but getting the track name was a little more complicated.
I have found on Github a simple PHP function that lets you to extract the MP3 metadata (StreamTitle) from a streaming URL header response. So on page refresh, it happily dumps the track name out for me, but this obviously only works once.
I plan to use a bit of Javascript to return this function via an Ajax call and update the current playing track.
However if I would like this to change when the track does. I cannot at this time think of anyway to do this, except to keep looping this method every few seconds and updating the DOM.
What I don't know is, is this acceptable. Will the server suffer from continuously running an Ajax call every 5s or so and will the stream URL allow me to do this constantly.
I am assuming that it will be fine because the amount of data sent and received is very small.
I am a bit out of my depth here and it is a last ditch effort before I just create a link to radio stations external player.
Thanks