Vonage / vonage-media-transformers-samples

Vonage Media Transformers Examples
MIT License
3 stars 3 forks source link

In Next JS am getting Error : "The source image could not be decoded." #64

Open rohanrana opened 4 months ago

rohanrana commented 4 months ago

Versions Next JS : 13.5.5 React : 18.2.0

import React, { Fragment } from "react";
import { createVonageMediaProcessor } from "@vonage/ml-transformers";
import bg1 from "../../../public/images/videocall/bg3.jpg";  // image is locallay imported

  const config = {
  transformerType: "VirtualBackground",
  backgroundAssetUri: bg1,
};
class NonEMDRPatient extends React.Component {
  async componentDidMount() {

    const processor = await createVonageMediaProcessor(config);
    this.setState({
      processor: processor,
    });
  }  
applyBackground = async(assetUri) => {
    let { processor } = this.state;

    config.backgroundAssetUri = assetUri;
    await processor.setBackgroundOptions(config);
  };

    handleRadioChange = (e) => {
    let { publisherObj } = this.state;
    this.setState({ bgRadio: e.target.value }, () => {
    this.applyBackground(bg1);

         }
  }
}

Here is a screen shot of error

image
rohanrana commented 4 months ago

@luqmanvonage @remi-deltombe-vonage please help on above