Camera stream as texture #4532
Unanswered
adrianposteuca
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I have no idea if that's even possible, but if you get it working, please let us know! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all ,
I would like to implement an idea. I want to use the camera video stream as a videoTexture.
my approach was to use this type of code
`customElements.whenDefined('model-viewer').then(async () => {
const videoElement = document.querySelector("#cameraFeed");
try {
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
videoElement.srcObject = stream;
await new Promise(resolve => videoElement.onplaying = resolve);
videoTexture = modelViewer.createVideoTexture(videoElement);
} catch (err) {
console.error("Error accessing the camera:", err);
}
});`
it doesn't seem to work
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions