How to put a image that changes dynamically depending on which dj is playing music in a online radio?
I have an online radio, where some DJs that make sets on the radio
I want that when one DJ is playing his set, the image on the top of the music player shows the image of the DJ, and when other DJ is playing his set, the top of the music player shows the photo of that other DJ.
It is done http://www.radiolocosxkko.com/
You can see the player on the top right of the website and the dynamically changing image on the top of the player
Ho开发者_开发问答w to implement that?
You have have to make an ajax call at regular intervals to find the details of the currently playing DJ, and then update the image accordingly i.e. polling and updating mechanism.
With HTML5 implementation in Webkit browsers, you will be able to use web sockets i.e. the server will be able to send the message to client browser when the DJ has changed.
精彩评论