Permalink
Browse files

Updates built files

Signed-off-by: Rick Waldron waldron.rick@gmail.com <waldron.rick@gmail.com>
  • Loading branch information...
rwaldron committed Feb 29, 2012
1 parent d2c13f2 commit 45435f85a24a135eac988db3581fcad9a422b311
Showing with 41 additions and 17 deletions.
  1. +32 −15 public/javascripts/dmv.js
  2. +1 −1 public/javascripts/dmv.min.js
  3. +7 −0 public/stylesheets/style.css
  4. +1 −1 views/index.jade
View
@@ -43,7 +43,7 @@ var // Localize navigator for use within getUserMedia
this.media = Operator.fixture( "video", this.id );
// This Operator's canvas
- this.canvas = Operator.fixture("canvas");
+ this.canvas = Operator.fixture( "canvas", this.id );
this.context = this.canvas.getContext("2d");
this.socket = socket;
@@ -69,18 +69,19 @@ var // Localize navigator for use within getUserMedia
Operator.prototype.draw = function() {
// Draw current video frame to the canvas
- this.context.drawImage( this.media, 0, 0, 280, 160 );
+ this.context.drawImage( this.media, 0, 0, this.canvas.width, this.canvas.height );
};
Operator.prototype.capture = function() {
- var capture = this.canvas.toDataURL(),
- image = document.querySelector( "#i_" + this.id );
-
- if ( !image ) {
- image = Operator.fixture( "img", this.id );
- }
-
- image.src = capture;
+ var capture = this.canvas.toDataURL();
+ // ,
+ // image = document.querySelector( "#i_" + this.id );
+ //
+ // if ( !image ) {
+ // image = Operator.fixture( "img", this.id );
+ // }
+ //
+ // image.src = capture;
// Dispatch a "capture" event to the socket
this.socket.emit( "capture", {
@@ -102,21 +103,37 @@ var // Localize navigator for use within getUserMedia
// Create an HTML element fixture
Operator.fixture = function( nodeName, id ) {
var container = document.querySelector("#container"),
- node = document.createElement( nodeName );
+ node = document.createElement( nodeName ),
+ other;
node.id = nodeName[0] + "_" + id;
- console.log( document.offsetWidth );
- node.style.width = "320px";
- node.style.height = "280px";
+ console.log( nodeName, window.innerWidth, window.innerHeight );
+
+ node.style.width = window.innerWidth + "px";// "320px";
+ // // node.style.height = window.innerHeight + "px";//"280px";
+ //
+ // node.width = window.innerWidth;
+ // node.height = window.innerHeight;
// TODO: make this definable
if ( !container ) {
container = document.body;
}
if ( nodeName === "canvas" ) {
- node.style.display = "none";
+ other = document.querySelector( "video[id$='" + id + "']" );
+
+ setTimeout(function check() {
+ if ( other.videoWidth > 0 ) {
+ node.width = other.videoWidth;
+ node.height = other.videoHeight;
+
+ node.style.visibility = "hidden";
+ } else {
+ setTimeout( check, 10 );
+ }
+ }, 10);
}
container.appendChild( node );

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,8 +1,15 @@
body {
+ padding: 0px;
+ margin: 0px;
/* padding: 50px;*/
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}
a {
color: #00B7FF;
+}
+
+video {
+ padding: 0px;
+ margin: 0px;
}
View
@@ -1,2 +1,2 @@
-#operator-container
+#container

0 comments on commit 45435f8

Please sign in to comment.