diff --git a/Uebertragung/WebApp/js/helper.js b/Uebertragung/WebApp/js/helper.js
index 389c15d..503ccb0 100644
--- a/Uebertragung/WebApp/js/helper.js
+++ b/Uebertragung/WebApp/js/helper.js
@@ -42,7 +42,6 @@ var calcOptimalSize = function(width, height, maxWidth, upscale=false) {
new_height = (height * ratio);
}
}
- console.log("optimal size: " + new_width + " x " + new_height);
return [new_width, new_height];
};
diff --git a/Uebertragung/WebApp/network-facade.js b/Uebertragung/WebApp/network-facade.js
index 470e38d..1ede4f7 100644
--- a/Uebertragung/WebApp/network-facade.js
+++ b/Uebertragung/WebApp/network-facade.js
@@ -23,6 +23,9 @@ var NetworkFacade = function (protocol) {
console.log('NetworkFacade does not support protocol type ' + this.protocol);
}
this.streamingVideo = null;
+ this.counter = 0;
+ this.start = null;
+ this.stop = null;
};
NetworkFacade.prototype.init = function(server, localName) {
@@ -77,12 +80,17 @@ NetworkFacade.prototype.startStreamVideo = function(video_source, width) {
var canvas = document.createElement("canvas");
canvas.setAttribute("type", "hidden");
var nwf = this;
+ this.start = performance.now();
this.streamingVideo = setInterval(function(){
+ var start = performance.now();
drawPictureToCanvas(video_source, video_source.videoWidth, video_source.videoHeight, canvas, width);
_image_data = canvas.toDataURL("image/jpeg");
_image_data = _image_data.replace(/^data:image\/jpeg;base64,/ig, "");
nwf.sendData(getXMLforPicture(canvas.width, canvas.height, _image_data));
- }, 50);
+ var stop = performance.now();
+ console.log(stop - start);
+ nwf.counter += 1;
+ }, 0);
return true;
}
else {
@@ -97,7 +105,9 @@ NetworkFacade.prototype.stopStreamVideo = function(e) {
hangUpFromHere();
}
else if(this.protocol == "WebSocket") {
+ this.stop = performance.now();
clearInterval(this.streamingVideo);
+ console.log(this.stop - this.start + "ms" + " counter: " + this.counter);
}
else {
// do nothing
diff --git a/Uebertragung/WebApp/video.html b/Uebertragung/WebApp/video.html
index a3dd94e..4e4b07a 100644
--- a/Uebertragung/WebApp/video.html
+++ b/Uebertragung/WebApp/video.html
@@ -22,7 +22,12 @@
navigator.getUserMedia (
// constraints
{
- video: true,
+ video: {
+ mandatory: {
+ maxWidth: 1280,
+ maxHeight: 720,
+ }
+ },
audio: false
},
@@ -68,7 +73,7 @@
}
-