From acbe4ca1331527b0a602767230a6e54544fb0c38 Mon Sep 17 00:00:00 2001 From: sidntrivedi012 Date: Fri, 23 Aug 2019 18:04:27 +0530 Subject: [PATCH] somewhat in working state --- examples/capture/capture.js | 122 +++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/examples/capture/capture.js b/examples/capture/capture.js index 8480f3cc..665be1e9 100644 --- a/examples/capture/capture.js +++ b/examples/capture/capture.js @@ -52,7 +52,7 @@ $W = { // height: 720, frame: 0, - initialize: function(args) { + initialize: function (args) { this.mobile = args["mobile"] || false; this.flipped = args["flipped"] == true || false; this.interface = args["interface"] || false; @@ -97,15 +97,15 @@ $W = { } setInterval($W.alert_overexposure, 500); // every 0.5 seconds - setInterval(function() { + setInterval(function () { $W.getRecentCalibrations(".select-calibration"); }, 10000); // every 10 seconds - $(".btn-switch-calibration-configure").click(function() { + $(".btn-switch-calibration-configure").click(function () { window.location = "/capture?calibration_id=" + $(".select-calibration-configure").val(); }); - $(".btn-switch-calibration-capture").click(function() { + $(".btn-switch-calibration-capture").click(function () { window.location = "/capture?calibration_id=" + $(".select-calibration-capture").val(); }); @@ -120,7 +120,7 @@ $W = { } }, - success: function(stream) { + success: function (stream) { //console.log('success') if ($W.options.context === "webrtc") { $("#heightIndicator").show(); @@ -135,7 +135,7 @@ $W = { //} if (navigator.mozGetUserMedia) video.mozSrcObject = stream; else video.srcObject = stream; - video.onerror = function(e) { + video.onerror = function (e) { stream.stop(); }; //video.play() @@ -149,7 +149,7 @@ $W = { console.log("flash or something else"); } }, - deviceError: function(error) { + deviceError: function (error) { //console.log(error) }, // options contains the configuration information for the shim @@ -179,17 +179,17 @@ $W = { quality: 100, context: "", - debug: function() {}, + debug: function () { }, // callback for capturing the fallback stream - onCapture: function() { + onCapture: function () { window.webcam.save(); }, - onTick: function() {}, + onTick: function () { }, // callback for saving the stream, useful for // relaying data further. - onSave: function(data) { + onSave: function (data) { // in progress for Flash now // seems to execute 240 times... once for each column? if ($W.loadingfromPi == false) { @@ -215,13 +215,13 @@ $W = { } } }, - onLoad: function() {} + onLoad: function () { } }, // Draws the appropriate pixels onto the top row of the waterfall. // Override this if you want a non-linear cross section or somethine // else special!