Skip to content

Commit

Permalink
further attempts at facingMode environment (publiclab#183)
Browse files Browse the repository at this point in the history
* further attempts at facingMode environment

* fixed facingmode!

* Update cypress.json
  • Loading branch information
jywarren authored Nov 15, 2020
1 parent ac970d6 commit 0cd9899
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"projectId": "128076ed-9868-4e98-9cef-98dd8b705d75"
"projectId": "8qkop6"
}
2 changes: 0 additions & 2 deletions dist/capture.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
26 changes: 9 additions & 17 deletions dist/spectral-workbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") {

Expand Down
8 changes: 6 additions & 2 deletions examples/capture/capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions examples/capture/getUserMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 0cd9899

Please sign in to comment.