Merge pull request #187 from atlasan/pulls

WebCamNodeFix
This commit is contained in:
Javi Agenjo
2021-06-14 12:26:37 +02:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -71,7 +71,7 @@ graph.start();</pre>
<h2>Example of editor</h2>
<ul>
<li><a href="demo">Module editor</a></li>
<li><a href="editor">Module editor</a></li>
</ul>
<h2>Documentation</h2>

View File

@@ -734,7 +734,7 @@
// Texture Webcam *****************************************
function ImageWebcam() {
this.addOutput("Webcam", "image");
this.properties = { facingMode: "user" };
this.properties = { filterFacingMode: false, facingMode: "user" };
this.boxcolor = "black";
this.frame = 0;
}
@@ -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;
}
@@ -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 }
};
navigator.mediaDevices
.getUserMedia(constraints)