Skip to main content
Version: 4.x.x

Network Events - iOS

VideoSDK provides the onQualityLimitation event to keep your app informed whenever media quality is affected or recovers in a room.

onQualityLimitation​

  • This event will be triggered when a quality limitation is detected or resolved in the room. It describes the video your device sends, such as your webcam or screen share.

  • It will pass type as an event callback parameter which will indicate the type of quality limitation affecting media performance. All possible types are :

    • CPU: Quality is limited due to high CPU usage.
    • BANDWIDTH: Quality is limited due to insufficient available bandwidth.
    • CONGESTION: Quality is limited due to network congestion.
  • It will pass state as an event callback parameter which will indicate whether a quality limitation is currently active or has been resolved. All possible states are :

    • DETECTED: The limitation is detected.
    • RESOLVED: The limitation is resolved.
  • It will pass timestamp as an event callback parameter which will indicate the time (in milliseconds since epoch) when the event occurred.

  • Implement this method of the RoomEventListener protocol, and register the listener with the addEventListener(_:) method of the Room class.

Example​

Here is the usage of the event mentioned in this page.

extension RoomViewController: RoomEventListener {
func onQualityLimitation(type: QualityLimitationType, state: QualityLimitationState, timestamp: Int) {
switch type {
case .CPU:
print("Quality limited due to high CPU usage: \(state) at \(timestamp)")

case .BANDWIDTH:
print("Quality limited due to low bandwidth: \(state) at \(timestamp)")

case .CONGESTION:
print("Quality limited due to network congestion: \(state) at \(timestamp)")

@unknown default:
break
}
}
}

API Reference​

The API references for all the methods and events utilised in this guide are provided below.

Got a Question? Ask us on discord