Skip to content

Commit

Permalink
Webcam node fix
Browse files Browse the repository at this point in the history
  • Loading branch information
atlasan committed Dec 16, 2020
1 parent 00add7f commit b91263c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nodes/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
// Texture Webcam *****************************************
function ImageWebcam() {
this.addOutput("Webcam", "image");
this.properties = { facingMode: "user" };
this.properties = { filterFacingMode: false, facingMode: "user" }; // atlasan edit
this.boxcolor = "black";
this.frame = 0;
}
Expand All @@ -744,8 +744,8 @@
ImageWebcam.is_webcam_open = false;

ImageWebcam.prototype.openStream = function() {
if (!navigator.getUserMedia) {
//console.log('getUserMedia() is not supported in your browser, use chrome and enable WebRTC from about://flags');
if (!navigator.mediaDevices.getUserMedia) {
console.log('getUserMedia() is not supported in your browser, use chrome and enable WebRTC from about://flags');
return;
}

Expand All @@ -754,7 +754,7 @@
// Not showing vendor prefixes.
var constraints = {
audio: false,
video: { facingMode: this.properties.facingMode }
video: !this.properties.filterFacingMode ? true : { facingMode: this.properties.facingMode } // atlasan edit
};
navigator.mediaDevices
.getUserMedia(constraints)
Expand Down

0 comments on commit b91263c

Please sign in to comment.