But it does not go full screen with this solution
by user 373346625025736705
CSS should take care off fullscreen, when playsInline is false
by user 474974683163394049
Will it be okay to share your project? May be I am missing something else!
by user 373346625025736705
sure thing I’ll create a github repo during the day and share it here. i’m again at work atm, so it will be very likely evening until you’ll get the link
by user 474974683163394049
i also fixed up the local run mode, making it work locally ^^
by user 474974683163394049
by user 474974683163394049
here you go just open the projects/Needle Engine Samples 2020_3 content in Unity and you’re ready to rock!
by user 474974683163394049
updated everything and moved the scripts from the “dev” examples into their respective Unity scene, installing the mediapipe npm package and tested locally. that should basically be a “open and run” for you
by user 474974683163394049
i even adapted the shadowRoot workflow, as this one seemed a little better suited for this kind of things.
by user 474974683163394049
Very cool, thanks for sharing! Do you have a deployed link to test this out?
Man you are a superhero. I have been following your YouTube channel for a while now. And now this!! You are out of this world
by user 373346625025736705
Sure thing: https://fdgs-needle-mediapipe.glitch.me/
by user 474974683163394049
Thank you :blobaww:
by user 474974683163394049
Btw @maXR could you imagine adding some of your stuff to the contributions too? Needle Engine Documentation
Ui, didn’t know about the contributions Oo I’ll take my time over the next few weeks and add some of my stuff
by user 474974683163394049
Nice thank you would be cool if there’s snippets that are easily shareable / not too much work
this whole post could end up there as a kind of “recipe” imho
by user 395602247196737546
hehe, i guess i should really write a short HowTo into the README.md of the repo. The post itself is unfortunately not very helpful for import and setup of a new project. Hopefully I’ll have time soon, to start writing
by user 474974683163394049
Here is a small sample script that does what @maXR described here it can be put anywhere in the scene
import { Behaviour, ClearFlags, RGBAColor } from "@needle-tools/engine";
export class VideoBackground extends Behaviour {
async awake() {
// create video element and put it inside the <needle-engine> component
const video = document.createElement("video");
video.style.cssText = `
position: fixed;
min-width: 100%;
min-height: 100%;
z-index: -1;
`
this.context.domElement.shadowRoot!.appendChild(video);
// get webcam input
const input = await navigator.mediaDevices.getUserMedia({ video: true })
if (!input) return;
video.srcObject = input;
video.play();
// make sure the camera background is transparent
const camera = this.context.mainCameraComponent;
if (camera) {
camera.clearFlags = ClearFlags.SolidColor;
camera.backgroundColor = new RGBAColor(125, 125, 125, 0);
}
}
}
Here’s a live link: https://linen-upbeat-sailboat.glitch.me/