From 0cd98994145f1c565c79b6adc6c5bb99ac63c53e Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Sun, 15 Nov 2020 15:30:30 -0500 Subject: [PATCH] further attempts at facingMode environment (#183) * further attempts at facingMode environment * fixed facingmode! * Update cypress.json --- cypress.json | 2 +- dist/capture.dist.js | 2 -- dist/spectral-workbench.js | 26 +++++++++----------------- examples/capture/capture.js | 8 ++++++-- examples/capture/getUserMedia.js | 2 -- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/cypress.json b/cypress.json index 34a7a48c..ba99d6c4 100644 --- a/cypress.json +++ b/cypress.json @@ -1,3 +1,3 @@ { - "projectId": "128076ed-9868-4e98-9cef-98dd8b705d75" + "projectId": "8qkop6" } diff --git a/dist/capture.dist.js b/dist/capture.dist.js index d8649714..6e6e0ed8 100644 --- a/dist/capture.dist.js +++ b/dist/capture.dist.js @@ -288,14 +288,12 @@ $W.updateResolution = function(resolution) { const constraints = { ...$W.defaultConstraints, - facingMode: { ideal: "environment" }, video: { ...$W.defaultConstraints.video, width: { min: width }, height: { min: height } } }; - const message = $('#resolution-message > small'); const successCallback = stream => { diff --git a/dist/spectral-workbench.js b/dist/spectral-workbench.js index 9caeeffd..8510c5fa 100644 --- a/dist/spectral-workbench.js +++ b/dist/spectral-workbench.js @@ -5371,38 +5371,30 @@ SpectralWorkbench.Graph = Class.extend({ d3.selectAll('g.nv-focus g.nv-line > g > g.nv-groups g') //.addClass('main-line') // we should do this (or the d3 equiv.) for later selections. Or if nvd3 offers a ready-made selection .attr("id", function(datum, index) { - if (index < 4) { - var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data - return 'spectrum-line-' + id; - } + var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data + return 'spectrum-line-' + id; }); // zoom graph lines d3.selectAll('g.nv-context g.nv-line > g > g.nv-groups g') .attr("id", function(datum, index) { - if (index < 4) { - var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data - return 'spectrum-line-' + id; - } + var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data + return 'spectrum-line-' + id; }); // graph line hover circles for main graph lines d3.selectAll('g.nv-focus g.nv-scatterWrap g.nv-groups g') .attr("id", function(datum, index) { - if (index < 4) { - var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data - return 'spectrum-hover-' + id; - } + var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data + return 'spectrum-hover-' + id; }); // graph line hover circles for zoom graph lines d3.selectAll('g.nv-context g.nv-scatterWrap g.nv-groups g') .attr("id", function(datum, index) { - if (index < 4) { - var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data - return 'spectrum-hover-' + id; - } - }); + var id = d3.select('svg').data()[0][index].id; // this is the real d3 DOM-stored data + return 'spectrum-hover-' + id; + }); if (_graph.dataType == "spectrum") { diff --git a/examples/capture/capture.js b/examples/capture/capture.js index e5608179..07134dd4 100644 --- a/examples/capture/capture.js +++ b/examples/capture/capture.js @@ -28,7 +28,12 @@ $W = { // width: 1280, // height: 720, frame: 0, - defaultConstraints: { video: true, audio: false }, + defaultConstraints: { + audio: false, + video: { + facingMode: "environment" + } + }, initialize: function(args) { this.mobile = args['mobile'] || false @@ -43,7 +48,6 @@ $W = { this.options.height = args['height'] this.options.width = args['width'] } - if (args.video_row) { this.sample_start_row = args.video_row; } else { diff --git a/examples/capture/getUserMedia.js b/examples/capture/getUserMedia.js index f27dd68d..c56f25ae 100644 --- a/examples/capture/getUserMedia.js +++ b/examples/capture/getUserMedia.js @@ -46,14 +46,12 @@ $W.updateResolution = function(resolution) { const constraints = { ...$W.defaultConstraints, - facingMode: { ideal: "environment" }, video: { ...$W.defaultConstraints.video, width: { min: width }, height: { min: height } } }; - const message = $('#resolution-message > small'); const successCallback = stream => {