Skip to content
Browse files

merged

  • Loading branch information...
2 parents a18cfe6 + 2f3ce78 commit bd7e23fbe97e2ad323a99c83131690d5de533691 @chrismatthieu committed Mar 19, 2011
Showing with 9 additions and 5 deletions.
  1. BIN audio/new_pm.mp3
  2. BIN audio/sound.mp3
  3. +2 −2 client-io.html
  4. +1 −1 client-io.js
  5. +6 −2 server-io.js
View
BIN audio/new_pm.mp3
Binary file not shown.
View
BIN audio/sound.mp3
Binary file not shown.
View
4 client-io.html
@@ -18,8 +18,8 @@
</div>
- <audio id="audio_new_pm" src="/audio/new_pm.wav" preload="auto"></audio>
- <audio id="audio_msg" src="/audio/sound.wav" preload="auto"></audio>
+ <audio id="audio_new_pm" src="/audio/new_pm.mp3" preload="auto"></audio>
+ <audio id="audio_msg" src="/audio/sound.mp3" preload="auto"></audio>
<div id="rooms"><ul></ul> &nbsp; <p align="right">Commands: /nick your_nick, /join a_new_room, /leave, <a href="/about.html" target="_blank">About Us</a></p></div>
View
2 client-io.js
@@ -148,6 +148,7 @@ socket.on('message', function(message){
break;
case "/list":
+ $('#n_' + room).html("");
_.each(data.slice(1).join(" ").split(","), function(data) {
n = data.split(":");
var nh = "#n_" + room + "_" + n[0];
@@ -330,7 +331,6 @@ function displayRoom(r) {
}
function refreshList(r) {
- $('#n_' + r).html("");
socket.send("/list " + r);
}
View
8 server-io.js
@@ -65,12 +65,12 @@ var httpServer = http.createServer(function(req, res) {
} else {
var path = url.parse(req.url).pathname;
- if(!/\.(js|html|swf|wav|css|png)$/.test(path)){
+ if(!/\.(js|html|swf|wav|css|png|mp3)$/.test(path)){
path = "/client-io.html";
}
switch (path) {
default:
- if (/\.(js|html|swf|wav|css|png)$/.test(path)){
+ if (/\.(js|html|swf|wav|css|png|mp3)$/.test(path)){
try {
var ct = "text/html";
@@ -86,6 +86,10 @@ var httpServer = http.createServer(function(req, res) {
ct = "audio/x-wav";
mode = "binary";
}
+ if(path.substr(-4) === '.mp3') {
+ ct = "type/mpeg";
+ mode = "binary";
+ }
if(path.substr(-4) === '.png') {
ct = "image/png";
mode = "binary";

0 comments on commit bd7e23f

Please sign in to comment.
Something went wrong with that request. Please try again.