Hi,
I am new to web dev and I am currently working on a college assignment for which I need to create an audio player that uses PHP to show different images according to the time of day. The website is for a radio station, and the audio player shows an image that would correspond to which radio program should be playing when the user is on the website.
For example:
If it is greater than or equal to 1am, and less than 5am, the audio player should show a certain image that corresponds with the radio show that would be on at that time.
All the audio player seem to do is show the first image on the list every time, no matter what time of day it is..
I have emailed wimpy player support team, and consulted my teacher, but I am not having much luck… so I hope someone can help!!
Please see code below:
<!– Wimpy Player –>
<div id=”wimpyplayer” style=”width:100%;height:100%;” data-wimpyplayer data-skin=”/Rad.tsv” data-coverArt=”<?php
$hour = date(‘G’);
switch ($hour) {
case ($hour >= 1 && $hour < 5);
echo “
break;
case ($hour >= 5 && $hour < 7);
echo “
break;
case ($hour >= 7 && $hour < 10);
echo “
break;
case ($hour >= 10 && $hour < 12);
echo “
break;
case ($hour >= 12 && $hour < 15);
echo “
break;
case ($hour >= 15 && $hour < 18);
echo “
break;
case ($hour >= 18 && $hour < 19);
echo “
break;
case ($hour >= 19 && $hour < 20);
echo “
break;
case ($hour >= 20 && $hour < 22);
echo “
break;
case ($hour >= 22 && $hour < 1);
echo “
break;
default: echo “No image to display”;
}
?>”data-responsive=1 data-startUpText=”Click play to listen live” data-loop=2 data-volume=0.5 data-linkEnable=1 data-disableControls=”pause,coverPlayPause,rewind,playlist” data-media='[{“title”:”The Early Shift”,”file”:”
>
</div>