akhil-rana / virtual-bg

Easily add virtual background effects to your video/camera input inside any web browser
MIT License
18 stars 7 forks source link

can it work with react native? #5

Closed fukemy closed 2 years ago

fukemy commented 2 years ago

as title

akhil-rana commented 2 years ago

I have not tested it with React Native.

I'm not sure if anyone else has or not.

But if it works with react as well as chromium on mobile then it might just work in react native too..

Though users have reported that safari has some issues so I'm not confident for ios.

I'm not much familiar with ReactNative so if you try it out let us know. :)

fukemy commented 2 years ago

bro thanks you for very quick reply. I know it's silly question, but im not familiar with web dev, can i ask you a question?

I saw your guide :

// applies an image background
const image = new Image();
image.src = 'https://imageurl.jpg'
applyImageBackground(image);

Did you mean you have a image above webrtcView, then apply effect into this image?

akhil-rana commented 2 years ago

bro thanks you for very quick reply. I know it's silly question, but im not familiar with web dev, can i ask you a question?

I saw your guide :

// applies an image background
const image = new Image();
image.src = 'https://imageurl.jpg'
applyImageBackground(image);

Did you mean you have a image above webrtcView, then apply effect into this image?

I'm not sure I understand your question. I'll try to explain ..

This adds a virtual image as a background to your camera feed.

const image = new Image(); image.src = 'https://imageurl.jpg'

These 2 lines creates a new JS Image() Object dynamically and adds it to the canvas which then acts as your virtual background.

You can see the working in the demo URL. The code of the demo is also open for you to view (top right icon on demo page)

fukemy commented 2 years ago

yes, thanks u i know it now