This widget relies on three parts to work:

  1. The Javascript code. The main script needs to be included from radiojar.com. It includes our own version of jQuery that uses the noConflict mechanism to avoid clashing with your own website's jQuery (if present).
  2. The HTML markup. Use the code provided, you can tweak it and add your own elements if you want as long as you keep the basic functioning parts that allow the Javascript code to work.
  3. The CSS. A starter stylesheet file is included inside the plugin. You can overwrite it though by including your own CSS file in the according settings to arrive at a design that matches your website's look & feel.

Check out the live demo below and click to get instructions for using the code on your website.

Show code Live example on JSFiddle

Include our sample stylesheet, in the <head> of your page:

<link rel="stylesheet" href="//www.radiojar.com/wrappers/api-plugins/v1/css/current-show.css">
            

Or download it and tweak it to your liking.

Include the following code at the point in your web page where you want to display the current show:

<div id="rjp-currentshow">
    <div class="element element-show-current" style="display: none;">
        <div class="wrapper">
             <h4 class="element-label"><i class="icon-microphone"></i> On air</h4>
             <div class="show">
                <div class="rjp-show-title-container">
			<h4 class="rjp-show-title" id="show-title"></h4>
			<h5 class="rjp-show-tagline" id="show-tagline"></h5>
		</div>
                <ul class="rjp-show-hosts" id="host-info"></ul>
            </div>
        </div>
    </div>
</div>
            

Include the following code just before the closing body tag. Instead of "u0510s7hb", use your station's streamname. You can find it in the management area of your station: select Tools and then Widgets (check out the screenshot to the right for the exact location). Please note that in case there is no scheduled show for a specific time then nothing will be displayed at that time as current show.

<script type="text/javascript" src="//www.radiojar.com/wrappers/api-plugins/v1/radiojar-min.js"></script>
<script>
   	rjq('#rjp-currentshow').radiojar('currentShow', {
		streamname: "u0510s7hb",
 	});
	
 	rjq('#rjp-currentshow').off('rj-show-change-event');
 	rjq('#rjp-currentshow').on('rj-show-change-event', function (event, data) {
	     if (data) {
	         rjq('.element-show-current').attr('style', 'display:block;background-image: url("//www.radiojar.com/content/shows/' + data.key + '/cover/")');
	         rjq('#show-title').html(data.title);
		 rjq('#show-tagline').html(data.tagline);
	         rjq('#host-info').empty();
	         rjq('#host-info').append('<li class="host-label">with:</li>');
	         for (x in data.host_profiles) {
	             rjq('.host-label').after('<li class="rjp-show-host"><img class="rjp-show-host-thumb" src="//www.radiojar.com/content/users/' + data.host_profiles[x].id + '/image/?resize=small"> ' + data.host_profiles[x].dj_info.nickname + ' </li>')
	         }
	     } else {
	         rjq('.element-show-current').attr('style', 'display:none;')
	     }
 });
</script>