AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
625 stars 227 forks source link

Cannot include Blur Background without a color. #762

Closed elenitaex5 closed 9 months ago

elenitaex5 commented 9 months ago

Describe the bug I made some test with this last summer... and now we are developing Video with Agora in React Native. Blur background could be include blurring my own (camera ) background, but now is always in WHITE. I had this in my code

   engine?.enableVirtualBackground(true,
          {
             backgroundSourceType: BackgroundSourceType.Blur,
             blur_degree: BackgroundBlurDegree.Medium
           }
         );

Checking documentation I found this:

export class VirtualBackgroundSource {
  /**
   * The custom background. See BackgroundSourceType.
   */
  background_source_type?: BackgroundSourceType;
  /**
   * The type of the custom background image. The color of the custom background image. The format is a hexadecimal integer defined by RGB, without the # sign, such as 0xFFB6C1 for light pink. The default value is 0xFFFFFF, which signifies white. The value range is [0x000000, 0xffffff]. If the value is invalid, the SDK replaces the original background image with a white background image. This parameter takes effect only when the type of the custom background image is BackgroundColor.
   */
  color?: number;

I cannot find a possibility of making it "transparent" or I need to add another color or different blur type? Colors seems not accept opacity.

To Reproduce

  1. Include Blur Background in your video
  2. Start a video. You will see a weird white bacgkround.

Expected behavior Having blur background with my own background as happen in React.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

guoxianzhe commented 9 months ago

@elenitaex5 Sorry,the value need to be rgb, does support alpha right now, and the range is [0x000000, 0xffffff]