xaringanExtra icon indicating copy to clipboard operation
xaringanExtra copied to clipboard

Feature: circular webcam window

Open spcanelon opened this issue 3 years ago • 2 comments

Hello @gadenbuie!

I think it'd be extra special to have the option for your webcam window to be a circle instead of a rectangle. Something about it looks really polished to me in some videos I've come across. I'm imagining a parameter in xaringanExtra::use_webcam() like shape = "circle".

This is very low-priority on my end because I rarely make videos, but I happen to be making one this week and wondered if others might like to have the option in the future.

spcanelon avatar Mar 19 '21 14:03 spcanelon

I actually need to make a recording of one of my presentations in the next couple weeks and wouldn't mind having this feature also. @gadenbuie Would you like me to make an attempt? I think it could work by simply placing the <video> in a <div> with some styling on the div for border-radius and overflow: hidden. Thoughts?

mattwarkentin avatar Mar 23 '21 14:03 mattwarkentin

@mattwarkentin that's basically it, except that you'll have to do some extra work to make sure that the video element is centered in the wrapping div. We don't have complete control over the video image size; we can ask for video at 200px x 200px but the browser/camera may give us video at a specific ratio that the camera supports. Feel free to take a pass at it!

gadenbuie avatar Mar 23 '21 15:03 gadenbuie