Skip to content

Commit b91263c

Browse files
committed
Webcam node fix
1 parent 00add7f commit b91263c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/nodes/graphics.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@
734734
// Texture Webcam *****************************************
735735
function ImageWebcam() {
736736
this.addOutput("Webcam", "image");
737-
this.properties = { facingMode: "user" };
737+
this.properties = { filterFacingMode: false, facingMode: "user" }; // atlasan edit
738738
this.boxcolor = "black";
739739
this.frame = 0;
740740
}
@@ -744,8 +744,8 @@
744744
ImageWebcam.is_webcam_open = false;
745745

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

@@ -754,7 +754,7 @@
754754
// Not showing vendor prefixes.
755755
var constraints = {
756756
audio: false,
757-
video: { facingMode: this.properties.facingMode }
757+
video: !this.properties.filterFacingMode ? true : { facingMode: this.properties.facingMode } // atlasan edit
758758
};
759759
navigator.mediaDevices
760760
.getUserMedia(constraints)

0 commit comments

Comments
 (0)