Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
27 lines (26 sloc) 0.728 kB
<html>
<head>
<script src="http://cdn.binaryjs.com/0/binary.js"></script>
<script>
// Connect to Binary.js server
var client = new BinaryClient('ws://localhost:9000');
// Received new stream from server!
client.on('stream', function(stream, meta){
// Buffer for parts
var parts = [];
// Got new data
stream.on('data', function(data){
parts.push(data);
});
stream.on('end', function(){
// Display new data in browser!
var img = document.createElement("img");
img.src = (window.URL || window.webkitURL).createObjectURL(new Blob(parts));
document.body.appendChild(img);
});
});
</script>
</head>
<body>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.