This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Jay Wong
Posted Sep 03 - Read on Facebook

Hey guys, I need some help =)

I'm trying to create a framer layer that can draw from the webcam and be manipulated as a normal framer layer.

In my example here, you can see that if I just write the code for the div manually it successfully can pull from the webcam, but as soon as I instead try to create a framer layer and insert that same html, it all of a sudden doesn't work.

Any ideas on how to fix this?

Thank you guys so much in advance!

3 Comments

Mike Feldstein

It looks like framer layers aren't actually inserted into the dom immediately, so you'll need to wait until they are before you can access child divs. I just wrapped the whole thing in a requestAnimationFrame as you can see here: http://codepen.io/msfeldstein/pen/ECByl

Jay Wong

Thank you so much Mike!

This ended up working too:
video400 = layer._element.querySelector("#circle-video-400")

Basically, since framer layers aren't actually in the document it was having trouble accessing the object.

Both solutions are great =). Thanks!

Daniel Lin

How are you using Framer together with codepen?

Read the entire post on Facebook