0

I'm experiencing a problem with Next.js. Whenever I try to go live, my computer gets stuck frequently. I am using Amazon IVS services and have followed the official Amazon documentation at "https://docs.aws.amazon.com/ivs/latest/userguide/broadcast-web-getting-started.html". I have checked the network and console, but there doesn't seem to be any issue with the code. If anyone has a solution, please kindly share it.

 ///start broadcast handler6
  async function startBroadcast() {
    ///create channel object
    const cannelObje = {
      name: mergeUserDetails,
      experienceId: Number(expId),
      roomName: roomId,
    };
    try {
      const result = await authApis.createVideoStreamChannel(
        cannelObje,
        accessToken
      );
      if (result.status === 200) {
        setCounter(counter + 1);
        const streamKeyEl = result.data.data.getChannelById.streamKey.value;
        setGetOfflineStausId(result.data.data.liveStream.id); ///set primary key
        setChatObject(result.data.data.liveStream.roomArn);
        setGetOfflineStatusId(result.data.data.liveStream.id);
        const endpointEl =
          "rtmps: url";
        const start = document.getElementById("start");
        setBroadcastLive(true);
        // createRoomToken(data); ///call token function;
        try {
          await clientObj?.startBroadcast(streamKeyEl, endpointEl);
        } catch (err) {
          console.log(err.toString());
        }
      }
    } catch (err) {
      console.log("err", err);
    }
  }
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 10 '23 at 12:17

0 Answers0