Permalink
Browse files

Added HTML structure

  • Loading branch information...
1 parent d254441 commit 49f1ba698b5a9ba950a0b2d25b25c70428b5d654 patrick committed Oct 21, 2012
Showing with 28 additions and 31 deletions.
  1. +0 −17 public/room.html
  2. +12 −2 server.js
  3. +1 −7 templates/index.jade
  4. +15 −5 templates/room.jade
View
@@ -1,17 +0,0 @@
-<html>
- <head>
- <script src='/socket.io/socket.io.js'></script>
- <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
-
- <script src='/room_client.js'></script>
- </head>
- <body>
- <video id="player" autoplay>
- <source src="http://192.168.1.72:8080/video.webm" type="video/webm">
- </video>
-
- <br/>
- <button id="pause">Pause</button>
- <button id="play">Play</button>
- </body>
-</html>
View
@@ -6,6 +6,10 @@ var io = require('socket.io').listen(server);
var uplawder = require('./uplawder.js');
server.listen(8080); // start listening on 8080
+
+rooms = [];
+roomID = 1;
+
app.configure(function () {
app.use(express.static(__dirname+'/public'));
//app.use(express.bodyParser({uploadDir: __dirname+'/uploads'}));
@@ -18,9 +22,15 @@ app.get('/', function (request, response) {
//response.sendfile(__dirname+'/index.html');
response.render('index');
});
+
+app.get('/getroom', function(req, res) {
+ rooms.push(roomID);
+ roomID++;
+});
+
app.get('/room/:id',function (req,res) {
console.log(req.params.id);
- res.render('room', { test: 'TEST'});
+ res.render('room', { roomName: req.params.id});
});
var DaStream='';
@@ -29,7 +39,7 @@ var DaData = new Buffer(0);
app.post('/upload', function (req, res) {
console.log('Uplawding');
- res.end('Uploading');
+ //res.end('Uploading');
DaStream = req.fileStream;
console.log(DaStream);
DaStream.on('data', function(data) {
View
@@ -1,10 +1,4 @@
doctype 5
html
- head
- script(src='/socket.io/socket.io.js')
- script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js')
- script(src='/index_client.js')
body
- form(action="/upload", method="post", enctype="multipart/form-data")
- input(type="file", name="video")
- button(type="submit") Go
+ a(href="/getroom") Try it now!
View
@@ -5,9 +5,19 @@ html
script(src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js')
script(src='/room_client.js')
body
- video(id="player")
- source(src="/stream/Abv",type="video/webm")
+ h2 Room #{roomName}
+ #uploader
+ form(action="/upload", method="post", enctype="multipart/form-data")
+ input(type="file", name="video")
+ button(type="submit") Go
+ br
+ br
+ br
+
+ #player
+ video(id="player")
+ source(src="/stream/Abv",type="video/webm")
- br
- button(id="pause") Pause
- button(id="play") Play
+ br
+ button(id="pause") Pause
+ button(id="play") Play

0 comments on commit 49f1ba6

Please sign in to comment.