收藏
回答

Taro.openChannelsLive报错。errCode=-4036?

export default function LivePlay() {

  const [liveInfo, setLiveInfo] = useState<LiveInfo>({});

  const getChannelsLiveInfo = async () => {

    await Taro.getChannelsLiveInfo({

      finderUserName: "sphfQQcpaP2faeS",

      success(res) {

        console.log(res, 777);

        setLiveInfo(res);

      },

      fail(res) {

        console.log(res, 888);

      },

    } as any);

  };


  useEffect(() => {

    getChannelsLiveInfo();

  }, []);

  const reserve = () => {

    Taro.openChannelsLive({

      // feedId: liveInfo.feedId!,

      finderUserName: "sphfQQcpaP2faeS",

      success(result) {

        console.log(result,21);

      },

      fail(res) {

        console.log(res,12);

        

      },

    });

  };

  return (

    <ChannelLive

      onClick={reserve}

      className="w-[100px] h-[100px]"

      feedId={liveInfo.feedId!}

      finderUserName="sphfQQcpaP2faeS"

    ></ChannelLive>

  );

}

回答关注问题邀请回答
收藏
登录 后发表内容