4

Agora Streams disconnects during Live Stream

  • I am using agora for live stream in my mobile app.

  • I am publishing the stream from web panel.

  • Sometimes streams work perfectly without any issue but sometimes it show me the below log messages.

    12:51:54:277 Agora-SDK [DEBUG]: [track-cam-45e38b11] current video dimensions: 640 480
      AgoraRTC_N-4.14.2.js:13 12:52:30:604 Agora-SDK [INFO]: [p2pId: 2]: 
      P2PConnection.onICEConnectionStateChange(disconnected)
      AgoraRTC_N-4.14.2.js:13 12:52:30:604 Agora-SDK [INFO]: [p2pId: 2]: 
      P2PConnection.onICETransportStateChange(disconnected)
      AgoraRTC_N-4.14.2.js:13 12:52:30:604 Agora-SDK [INFO]: [p2pId: 2]: 
      P2PConnection.onConnectionStateChange(disconnected)
      AgoraRTC_N-4.14.2.js:13 12:52:31:855 Agora-SDK [INFO]: [p2pId: 2]: 
      P2PConnection.onICEConnectionStateChange(connected)
    
  • After the above log messages On audience devices it struck and never start again.

  • I am very much confused about this, Your small help would be really appropriated.

Muhammad Ibrahim
  • 511
  • 1
  • 3
  • 13
  • Please have a look at my question https://stackoverflow.com/questions/74223998/agorartcexception-agorartcerror-ws-abort-type-ping – Zar E Ahmer Nov 02 '22 at 07:01

2 Answers2

0

I don't have enough reputation to add a comment but you should do the following to debug your issues.

  import RtcEngine from "react-native-agora"
  ...
  const engine = await RtcEngine.create(AGORA_APP_ID)
  engine.addListener("Warning", warn => {
      RtcEngine.getErrorDescription(warn).then(console.log)
    })

    engine.addListener("Error", err => {
      RtcEngine.getErrorDescription(err).then(console.log)
    })

Check the error and warning you get, my first guess is that your token is probably expiring during the stream and if that's the case, you can renew your token

Nziranziza
  • 39
  • 5
0

According to the Agora documentation, the ICEConnectionState indicates the state of the peer-to-peer connection between the local client and the remote client. The possible values are:

  • new: The ICE agent is gathering addresses or waiting for remote candidates.
  • checking: The ICE agent has remote candidates and is checking pairs of local and remote candidates against one another to try to find a compatible match, but has not yet found a pair which will allow the peer connection to be made. It's possible that gathering of candidates is also still underway.
  • connected: A usable pairing of local and remote candidates has been found for all components of the connection, and the connection has been established. It's possible that gathering is still underway, and it's also possible that the ICE agent is still checking candidates against one another looking for a better connection to use.
  • completed: The ICE agent has finished gathering candidates and checking them against one another. A connection has been established for all components of the connection, and the best possible connection has been found and selected.
  • disconnected: The ICE agent has determined that the connection is no longer viable. This can happen, for example, if a laptop is closed and then later re-opened.
  • failed: The ICE agent has checked all candidates pairs against one another and has failed to find compatible matches for all components of the connection. It has given up looking for a usable connection.
  • closed: The ICE agent has shut down and is no longer handling requests.

In your case, it seems that the ICE agent has detected a temporary loss of connectivity between the web panel and the mobile app, and has switched to the disconnected state. However, it has not given up on the connection and has resumed checking for a compatible match, and has eventually found one and switched back to the connected state.

The reason for this intermittent disconnection could be due to various factors, such as network congestion, firewall settings, bandwidth limitations, or device performance. To troubleshoot this issue, you can try the following steps:

PaulvdBoor
  • 296
  • 2
  • 2