Skip to main content

Livestream Events

You can listen to livestream events by conforming to the RtkLiveStreamEventsListener protocol and attaching the listener to the meeting instance:

class LivestreamViewController: UIViewController, RtkLiveStreamEventsListener {
override func viewDidLoad() {
super.viewDidLoad()

// Attach the livestream listener
meeting.addLiveStreamEventsListener(liveStreamEventsListener: self)
}

// MARK: - RtkLiveStreamEventsListener

func onLivestreamStateChanged(oldState: LiveStreamState, newState: LiveStreamState) {
// Called when the livestream state transitions from `oldState` to `newState`.
}

func onLivestreamError(message: String) {
// Called when an error occurs during the livestream lifecycle.
}

func onViewerCountUpdated(count: Int32) {
// Called whenever the viewer count is updated.
}

func onLivestreamUpdate(data: RtkLivestreamData) {
// Called when additional livestream metadata is updated.
}
}