Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image blurring and set a custom image as the publisher's background #749

Open
ankitbishtapollo opened this issue May 7, 2024 · 3 comments

Comments

@ankitbishtapollo
Copy link

Could you please provide instructions on how to utilize the setVideoTransformers method with example? Specifically, I aim to implement image blurring and set a custom image as the publisher's background

@beHaze
Copy link

beHaze commented May 29, 2024

Hello @ankitbishtapollo, I see that you are woking with support but here are some docs for blur https://tokbox.com/developer/guides/audio-video/react-native/#video-filters

@ankitbishtapollo
Copy link
Author

Hi @beHaze . I've already tried that but its not working.

Code versions used -
opentok-react-native: 2.27.4
react-native: 0.68.0
react: 17.0.2

Device info -
Real iPhone device - 11 and OS version 17.0.3

Code used -

const otPublisherRef = useRef<any>(null);
# For image blurring
<OTPublisher
      ref={(ref) => (otPublisherRef.current = ref)}
      eventHandlers={{
        streamCreated: (event) => {
          otPublisherRef.current.setVideoTransformers([
            {
              name: 'BackgroundBlur',
              properties: JSON.stringify({
                radius: 'low',
              }),
            }
          ]);
        },
      }}
    />

# For image replacement
<OTPublisher
      ref={(ref) => (otPublisherRef.current = ref)}
      eventHandlers={{
        streamCreated: (event) => {
          otPublisherRef.current.setVideoTransformers([
            {
              name: 'BackgroundReplacement',
              properties: JSON.stringify({
                image_file_path: "https://img.freepik.com/free-vector/abstract-digital-grid-vector-black-background_53876-111550.jpg"
              }),
            }
          ]);
        },
      }}
    />

@beHaze
Copy link

beHaze commented Jun 12, 2024

We have discovered an issue and are investigating internally (VIDCS-2280).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants