Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some cleaning

  • Loading branch information...
commit 28cfb2a9b123cb2a1182eb2536d4f8fe8e5780ed 1 parent b3a7cef
fadomire authored
8 app.js
View
@@ -2,7 +2,7 @@ var express = require("express"),
BinaryServer = require('binaryjs').BinaryServer,
fs = require('fs');
-var port = process.env.PORT || process.env.VMC_APP_PORT || 8080;
+var port = process.env.PORT || 8080;
var app = express(),
server = require('http').createServer(app),
@@ -20,6 +20,7 @@ bs.on('connection', function (client){
for(i in clients){
// Dont send data to the broadcaster and dont create a new stream if already exists
if(client!=clients[i] && Object.keys(clients[i].streams).length == 0){
+ console.log(clients[i].id);
clientStreams.push(clients[i].createStream({clientId : clients[i].id}));
}
}
@@ -27,13 +28,8 @@ bs.on('connection', function (client){
for(i in clientStreams){
stream.pipe(clientStreams[i]);
}
-
- stream.on('open', function (stream){
- console.log(stream);
- });
stream.on('end', function (){
console.log("stream is received 100% on server")
- //client.close();
});
});
});
14 manifest.yml
View
@@ -1,14 +0,0 @@
----
-applications:
- .:
- name: videoStreaming
- framework:
- name: node
- info:
- mem: 64M
- description: Node.js Application
- exec:
- infra: eu-aws
- url: ${name}.${target-base}
- mem: 64M
- instances: 1
4 package.json
View
@@ -1,6 +1,6 @@
{
"name": "coccoon",
- "version": "0.0.1-19",
+ "version": "0.0.1-25",
"dependencies": {
"express": "3.0.6",
"binaryjs": "0.1.7",
@@ -10,7 +10,7 @@
"node": "0.8.x",
"npm": "1.1.65"
},
- "subdomain": "fadomire.cocoon",
+ "subdomain": "fadomire.videostreaming",
"scripts": {
"start": "app.js"
}
14 public/js/client.js
View
@@ -59,25 +59,11 @@
console.log("stream 100% received on client")
stream.destroy();
});
- stream.on('drain', function (){
- console.log('stream drained')
- });
- }, false);
-
-
- // if(mediaSource.sourceBuffers.length>0){
- // mediaSource.removeSourceBuffer(mediaSource.sourceBuffers[0]);
- // }
-
-
- mediaSource.addEventListener('webkitsourceended', function(e) {
- console.log('mediaSource readyState: ' + this.readyState);
}, false);
});
});
client.on('close', function (){
console.log('client closed')
-
});
//})();
6 views/index.ejs
View
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
- <title>Cocoon</title>
+ <title>Video Streaming</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
@@ -22,7 +22,7 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
- <a class="brand" href="/">Cocoon</a>
+ <a class="brand" href="/">Video Streaming</a>
<a href="https://github.com/FlintMakal/videoStreaming"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
</div>
</div>
@@ -32,6 +32,8 @@
<div class="row">
<div class="span5 center">
<section id="app">
+ <p>Experiment for video streaming in node.js with binaryjs package</p>
+ <p>To use it, open 2 chrome browser on this page and choose a video webm file on one. Once you click play the video will be streamed to the other browser.</p>
<input id="videoSource" type="file" accept="video/*"/>
</section>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.