Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Custom Made Radio Player For Client

Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
Today I'm releasing my radio player that I coded from scratch inspired by Flat-UI and SVG.
This took me many weeks to make, I was going to keep it private but I've decided to share it with the retro community.

Features:
  • Option to delete a stream from the playlist page.
  • Web Notification box on station change.
  • SVG Icons (ex:Moving Visualizer)
  • Radio resizes with window
  • And others.

Tips:
- To change/add radio stations, go to rScript.php on line 556.

- To change which station displays first, go to rScript.php on line 24. (Index 0 would be the first station and so on.)

- You can change the notification image by going to rScript.php on line 554.

- You should already know css, (Located on clientradio.php)


Screenshots:
- Main:
- Volume on hover:
- Playlist:
- Notification:


Install Instructions:
1.) Extract contents anywhere you like.
2.) Go to client.css and change height to 95%
3.) Go to client.php and use php include to call the files.
3.1) Place the code listed below right above </head> and change the path.
PHP:
<?php include ('/rScript.php');?>
3.2) Place the code listed below right below <div id="client"></div> and change the path.
PHP:
<?php include ('/clientradio.php');?>


Download:



Need Help? Skype: jacob.lucado


For anyone having trouble, here's a copy of my client.php and client.css

Client.php:
Code:
<!DOCTYPE HTML><html lang="en">


    <head>
    
    
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
         
        
        <link rel="stylesheet" href="{url}/app/tpl/skins/{skin}/styles/client.css?<?php echo time() ?>" type="text/css">
        <script type="text/javascript" src="{url}/app/tpl/skins/{skin}/js/swfobject.js?<?php echo time() ?>"></script>
        <script type="text/javascript">
            var BaseUrl = "{url}/game";
            var flashvars =
            {
                "client.starting" : "Welcome {username}, {hotelname} is loading!",
                "client.allow.cross.domain" : "1", 
                "client.notify.cross.domain" : "0", 
                "connection.info.host" : "I.P", 
                "connection.info.port" : "PORT", 
                "site.url" : "{url}", 
                "url.prefix" : "{url}", 
                "client.reload.url" : "{url}/client", 
                "client.fatal.error.url" : "{url}/disconnected", 
                "client.connection.failed.url" : "{url}/disconnected", 
                "external.variables.txt" : "{url}/game/gamedata/external_variables.txt", 
                "external.texts.txt" : "{url}/game/gamedata/external_flash_texts.txt", 
                "productdata.load.url" : "{url}/game/gamedata/productdata.xml", 
                "furnidata.load.url" : "{url}/game/gamedata/furnidata.xml", 
                "use.sso.ticket" : "1", 
                "sso.ticket" : "{sso}", 
                "processlog.enabled" : "0", 
                "flash.client.url" : BaseUrl + "/", 
                "flash.client.origin" : "popup" 
            };
            var params =
            {
                "base" : BaseUrl + "/",
                "allowScriptAccess" : "always",
                "menu" : "false"                
            };
            swfobject.embedSWF(BaseUrl + "/SwitchLucado.swf", "client", "100%", "100%", "10.0.0", "{url}/game/expressInstall.swf", flashvars, params, null);
        </script>
        <?php include ('/rScript.php');?>
    </head>
   
    <body>
    
    <link href="http://fonts.googleapis.com/css?family=Ubuntu:regular,bold&subset=Latin" rel="stylesheet" type="text/css">
    <script language="JavaScript"> window.moveTo(0, 0); window.resizeTo(screen.width, screen.height) </script>
    <script>
        setTimeout(function() { removeLoader(); }, 5000);
        function removeLoader()
        {
            document.getElementById("loadingpage").style.height='0px';
            document.getElementById("img1").style.height='0px';
            document.getElementById("font1").style.height='0px';
            document.getElementById("img2").style.height='0px';
        }
    </script>


    <div id="loadingpage">
        
        
        
    </div>
    
    
        <div id="client"></div>
    <?php include ('/clientradio.php');?>
     
<script type="text/javascript">
this.blankwin = function(){
        var dlists = new Array();  
 dlists[0] = 'forum.ragezone.com'; 

	var hostname = window.location.hostname;
	hostname = hostname.replace("www.","").toLowerCase();
	var a = document.getElementsByTagName("a");	
	this.check = function(obj){
		var href = obj.href.toLowerCase();
                var dbopcount = 0;
                if (href.indexOf("http://")!=-1)
                {
                   for (jdi = 0; jdi <= dlists.length; jdi++)
                   {
                      if (href.indexOf(dlists[jdi]) == -1)
                      {
                         //alert("NO MATCH " + dlists[jdi] + " " + href);
                         dbopcount = dbopcount;  //Do nothing
                      }
                      else
                      {
                         //alert("match " + dlists[jdi] + " " + href);
                         dbopcount++;
                      }
                   } 
                   if (dbopcount > 0)
                     return true; //If this link URL was an internal URL
                   else  //there were no matches to any internal domain, so leave it external
                     return false;
                }
                else
                {
                  return false;
                }
		//return (href.indexOf("http://")!=-1 && href.indexOf(hostname)==-1) ? false : true;				
	};
	this.set = function(obj){
		obj.target = "_self";
	};	
	for (var i=0;i<a.length;i++){
		if(check(a[i])) set(a[i]);
	};		
};

// script initiates on page load. 

this.addEvent = function(obj,type,fn){
	if(obj.attachEvent){
		obj['e'+type+fn] = fn;
		obj[type+fn] = function(){obj['e'+type+fn](window.event );}
		obj.attachEvent('on'+type, obj[type+fn]);
	} else {
		obj.addEventListener(type,fn,false);
	};
};
addEvent(window,"load",blankwin);
</script>
</body>
    
</html>
Client.css:
Code:
html, body.flashclient {
    height: 95%;
    background-color: black;
    color: white;
}
body {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    overflow: hidden;
    background-color: black;
    color: white;
}


#client {
    width: 100%;
    height: 100%;
}
#loadingpage {
    background-color: black;
    -webkit-transition: all 1s ease-in-out;
    -moz-transition: all 1s ease-in-out;
    -o-transition: all 1s ease-in-out;
    transition: all 1s ease-in-out;
    width: 100%;
    height: 1000%;
    background-color: black;
}


#load {
    -moz-transition: all 1s ease-in-out;
    -o-transition: all 1s ease-in-out;
    transition: all 1s ease-in-out;
}
.start-1 {
    font-family: 'Oleo Script', Helvetica, sans-serif;
    color: white;
    font-size: 100px;
    margin-top: 200px;
}
#img1 {
    margin-top: 30%;
}
#img2 {
    height: 40px;
    margin-top: 20px;
}
#font1{
    color: white;
    font-size: 24px;
    font-weight: bold;
    font-family: Ubuntu;
}
Want it to blend in with the client bar? Update the clientradio.php style with the following code.
Code:
*,
*:before,
*:after {
  box-sizing: border-box;
}


.hide {
  display: none!important;
}


button {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}


.ap {
  position: fluid;
  right: 0;
  bottom: 0;
  left: 0;
  height: 48px;
  margin: auto;
  font-family: Arial, sans-serif;
  font-size: 14px;
  user-select: none;
  color: #333;
  background: #1C1C1A;
  border-top: 1px solid #1C1C1A;
  z-index: 9999;
  -webkit-transition: all 30s ease-in-out;
  -moz-transition: all 30s ease-in-out;
  -o-transition: all 30s ease-in-out;
  transition: all 1s ease-in-out;
}


.ap-inner {
  max-width: 1440px;
  margin: 0 auto;
}


.ap-panel {
  display: flex;
}


.ap-item {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
}


.ap--track {
  flex: 1 40%;
  padding: 0 20px;
}


.ap-info {
  width: 100%;
  position: relative;
  align-self: flex-start;
  padding: 5px 0 0;
}


.ap-title {
  position: relative;
  overflow: hidden;
  padding-right: 80px;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: white;
}


.ap-title:hover {
  position: relative;
  overflow: hidden;
  padding-right: 80px;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: red;
  font-weight: bold;
}


.ap-time {
  position: absolute;
  top: 5px;
  right: 0;
  color: white;
}


.ap-time:hover {
  position: absolute;
  top: 5px;
  right: 0;
  color: red;
  font-weight: bold;
}


.ap-progress-container {
  padding: 5px 0 10px;
  cursor: pointer;
}


.ap-progress {
  position: relative;
  height: 3px;
  border-radius: 5px;
  background: #eee;
}


.ap-preload-bar,
.ap-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 5px 0 0 5px;
  background: rgba(0, 0, 0, .3);
  z-index: 999;
}


.ap-bar {
  background: red;
  z-index: 9999;
}


.ap-bar:after {
  position: absolute;
  top: 0;
  right: -5px;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  content: '';
  border-radius: 6px;
  background: red;
  opacity: 0;
  transition: opacity .3s ease;
}


.ap-progress-container:hover .ap-bar:after {
  opacity: 1;
}


.ap-controls {
  position: relative;
  z-index: 1000;
  display: block;
  height: 50px;
  cursor: pointer;
  transition: background .2s ease;
  text-align: center;
  color: #fff;
  border: 0;
  outline: 0;
  background: none;
}


.ap-controls svg {
  fill: #eee;
}


.ap-controls:hover svg {
  fill: red;
}


.ap-controls:active {
  background: rgba(0, 0, 0, 3);
}


.ap--playback>.ap-controls,
.ap--settings>.ap-controls {
  flex: 0 25%;
}


.ap--pause,
.playing>.ap--play {
  display: none;
}


.playing>.ap--pause {
  display: inline;
}


.ap-volume-container {
  z-index: 9999;
}


.ap-volume {
  position: absolute;
  right: 0;
  bottom: 50px;
  overflow: hidden;
  width: 100%;
  height: 0;
  visibility: hidden;
  transition: height .2s cubic-bezier(0.17, 0.72, 0.26, 1.23);
  background: #1C1C1A;
  opacity: 0.7;
  border: 1px solid #1C1C1A;
  border-bottom: 0;
  z-index: 9999;
}


.ap-volume-btn {
  display: block;
  text-align: center;
  width: 100%;
}


.ap-volume-btn>.ap--volume-off,
.muted>.ap--volume-on {
  display: none;
}


.muted>.ap--volume-off {
  display: inline;
}


.ap-volume-container:hover {
  background: #696969;
}


.ap-volume-container:hover .ap-volume {
  height: 120px;
  visibility: visible;
}


.ap-volume-progress {
  display: block;
  width: 4px;
  height: 100px;
  margin: 10px auto;
  background: rgba(0, 0, 0, .2);
  position: relative;
  border-radius: 3px;
}


.ap-volume-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: red;
  height: 50%;
  border-radius: 3px;
}


.ap-active {
  background: rgba(0, 0, 0, .15);
  opacity: 1;
}

 @[I][B][URL="https://forum.ragezone.com/members/363813.html"]KEY[/URL][/B][/I]frames blink {
  from {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}


.playing>.ap--pause {
  animation: blink 1.9s linear infinite;
}

 @[I][B][URL="https://forum.ragezone.com/members/1333434998.html"]Media[/URL][/B][/I](max-width:880px) {
  .ap-item > .ap-controls {
    flex: 1;
  }
}

 @[I][B][URL="https://forum.ragezone.com/members/1333434998.html"]Media[/URL][/B][/I](max-width:550px) {
  .ap {
    min-width: 250px;
  }
  .ap,
  .ap-panel {
    height: auto;
  }
  .ap-panel {
    flex-wrap: wrap;
  }
  .ap--track {
    margin-bottom: 10px;
    padding: 0 20px;
    order: 1;
    flex: 1 1 100%;
  }
  .ap--playback,
  .ap--settings {
    flex: 1 1 50%;
    order: 2;
  }
}




/*--------------------
  PlayList
--------------------*/


.pl-container {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 50px;
  left: 0;
  margin: auto;
  overflow: auto;
  font-family: Arial, sans-serif;
  font-size: 14px;
  background: #000;
  opacity: 0.7;
  z-index: 999;
}


.pl-lead {
  font-size: 24px;
  font-weight: 400;
  text-align: center;
  color: #333;
}


.pl-list {
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
  padding: 30px 10px;
}


.pl-list > li {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ddd;
}


.pl-number,
.pl-title,
.pl-remove {
  margin: 0 5px;
  padding: 10px 0;
}


.pl-number {
  flex: 0 10%;
  text-align: center;
}


.pl-playing {
  display: none;
  fill: rgb(255, 250, 250);
}


.pl-current .pl-count {
  display: none;
}


.pl-current .pl-playing {
  display: block;
}


.pl-current .pl-title {
  font-weight: 700;
}


.pl-title {
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}


.pl-title:hover {
  text-decoration: underline;
  font-weight: bold;
  font-style: italic;
  color: red;
}


.pl-remove {
  opacity: 0;
  margin-right: 0;
  cursor: pointer;
  text-align: center;
  flex: 0 50px;
}


.pl-remove:hover {
  background: red;
}


.pl-list > li:hover .pl-remove {
  opacity: 1;
}


.pl-list svg {
  fill: rgb(255, 250, 250);
}


.pl-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 2rem;
  transform: translate(-50%, -50%);
  letter-spacing: 2px;
  color: #ccc;
}

 @[I][B][URL="https://forum.ragezone.com/members/363813.html"]KEY[/URL][/B][/I]frames eq {
  0% {
    height: 3px;
  }
  50% {
    height: 20px;
  }
  100% {
    height: 3px;
  }
}


.eq {
  display: flex;
  width: 20px;
  height: 20px;
  margin: 0 auto;
  justify-content: space-between;
  align-items: flex-end;
}


.eq-bar {
  width: 4px;
  background: rgb(255, 250, 250);
}


.eq-bar:nth-child(1) {
  animation: eq .8s ease-in-out infinite 0s;
}


.eq-bar:nth-child(2) {
  animation: eq .8s ease-in-out infinite .2s;
}


.eq-bar:nth-child(3) {
  animation: eq .8s ease-in-out infinite .4s;
}

Screen of new style of above code:

Like it? Like the post. :thumbup1:
 
Last edited:
Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
This is nice but the radio being under the bar would annoy me to much!

Good Release!

Yea, I tried making it be on-top but the client only shortens from the bottom.

Only other method is making is smaller, but then I'd have to resize the entire bar and SVG icons.

All-in-all, It's a pretty sleek, and stylish player. People can just put it on the actual webpages instead of the client.
Just change the #ap css positions to :fixed and it'll lock on the bottom of the website.
I probably should have mentioned that in my thread. xD
 
Newbie Spellweaver
Joined
Jan 14, 2015
Messages
12
Reaction score
1
For me it just sais ERROR. no buttons work but i can see the radio in the client!
 
Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
Which formats does it support? Ogg, Wav, mp3? want to know

Any audio type.



For me it just sais ERROR. no buttons work but i can see the radio in the client!

It's not my code that is causing that, it is your server.



I'm more interested in the room background. Anyone know where thats from :love:?

Nice release :):

Images, floor plan, and coordinates for that room:


Code:
[LIST=1]
[*][COLOR=#000000]http://images.habbo.com/c_images/album3835/gh15_a.png -347 494 8775[/COLOR]
[*][COLOR=#000000]http://images.habbo.com/c_images/album3835/gh15_b.png -859 598 8775[/COLOR]
[*][COLOR=#000000]http://images.habbo.com/c_images/album3835/gh15_c.png -171 1006 8775[/COLOR]
[*][COLOR=#000000]http://images.habbo.com/c_images/album3835/gh15_d.png -519 1006 8775[/COLOR]
[*][COLOR=#000000]http://images.habbo.com/c_images/album3835/gh15_e.png -930 1110 8775[/COLOR]
[*][COLOR=#000000]http://images.habbo.com/c_images/album3835/gh15_f.png -662 1179 8775
[/COLOR]
[/LIST]

Floor plan.
Code:
xxxxxxxxxxxxxxxxxxxxxx
xxxxxddddxxxxxxxxxxxxx
xxxxxddddxxxxxxxxxxxxx
xxxxxddddxxxxxxxxxxxxx
xxxxxddddxxxxxxxxxxxxx
xbbbb9999xxxxxxxxxxxxx
xbbbb9999xxxxxxxxxxxxx
xbbbb9999xxxxxxxxxxxxx
xbbbb9999xxxxxxx8xxxxx
xxxxxxxxxx000000000000
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxf000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx000000000000x
xxxxxxxxx00xxxxxxxxxxx
 
Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
One idea for people is to create a dragable window. I wish I still had the code for one I once used.

Working on one of those now, just having issues with getting it to be responsive.
See .
 
Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
You could've at least made it so it doesn't blast music on the page load, set the volume to like 25% or have it not play on load.

Yea, I forgot about that as I usually keep my volume on 10 anyway. I've updated it, made it more responsive, etc. Volumes fixed, autoplay is off. You can find it here.
 
Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
Currently working on a more stylish slide-in player. Has a horrid show/hide feature right now as for some reason SlideToggle doesn't want to work anymore. >.<
C
 
The one and only!
Loyal Member
Joined
Nov 24, 2008
Messages
2,529
Reaction score
1,435
I like it but don't like the placement.

There's not much you can do on the client but just an idea, here's what I did at Habboon a couple years ago:
tgPUgRB - Custom Made Radio Player For Client - RaGEZONE Forums

(picture courtesy of Glee)

Just a basic HTML overlay designed to blend in with the other boxes on the top right with all the data fed straight from the SHOUTcast panel. I got lazy and never finished the send request button but the plan was for it to use jQuery and open a simple text box from within the client where the user can submit a request. Obviously that needs integration with a radio panel though so you wouldn't be able to make it a generic radio player.



--



Good work though. Besides the placement (not much you can do) it's a great, looks very functional and I like the use of Chrome notifications for the song.
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Dec 28, 2011
Messages
185
Reaction score
59
Wow sounds nice.. But i only see you posting Radio Stuff, i think it's the fifth post about a different radio script.. (player)

I do a lot of work for online radio stations, I've made so many different one's that I decided to release a few of them for retros to use.

I'll be releasing different stuff that'll actually 'contribute' to the community soon.
 
Back
Top