Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No camera feed #15

Open
IshanDindorkar opened this issue May 30, 2021 · 1 comment
Open

No camera feed #15

IshanDindorkar opened this issue May 30, 2021 · 1 comment

Comments

@IshanDindorkar
Copy link

Hello Everyone,

I am trying to integrate camera module in MagicMirror. I am using Frontech web camera. Tried everything like changing display: false to display: true. But no success yet.
I know this issue has been raised before, couple of times. But I couldn't see any more discussion on those issues. I am creating this new issue to reach out to people who could successfully fixed this problem. I would greatly appreciate your guidance. Thank you in advance!

@IshanDindorkar
Copy link
Author

I think I found solution to this problem. I will share what worked for me. I hope it will work for you as well -
In webcam.js, I commented these lines -

                    // var self = this;
		// this.mediaDevices.getUserMedia({
		// 	"video": true
		// 	// "audio": false,
		// 	// "video": this.params.constraints || {
		// 	// 	mandatory: {
		// 	// 		minWidth: this.params.dest_width,
		// 	// 		minHeight: this.params.dest_height
		// 	// 	}
		// 	// }
		// })
		// .then( function(stream) {
		// 	// got access, attach stream to video
		// 	video.onloadedmetadata = function(e) {
		// 		self.stream = stream;
		// 		self.loaded = true;
		// 		self.live = true;
		// 		self.dispatch('load');
		// 		self.dispatch('live');
		// 		self.flip();
		// 	};
		// 	video.src = window.URL.createObjectURL( stream ) || stream;
		// })
		// .catch( function(err) {
		// 	return self.dispatch('error', err);
		// });

Instead I replaced above lines with this code -

if (navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ video: true })
.then(function (stream) {
video.srcObject = stream;
})
.catch(function (error) {
console.log("Something went wrong!");
});
}

I hope this will work for you also.

All the best!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant