Skip to main content
Version: 4.x.x

RTMP Events - iOS

VideoSDK provides onLivestreamStateChanged event which will notify you of the current state of livestream for the room.

onLivestreamStateChanged​

  • This event will be triggered when the room's livestream status changes.
  • 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 onLivestreamStateChanged(state: LiveStreamState) {
switch(state) {
case .LIVESTREAM_STARTING:
print("livestream starting")

case .LIVESTREAM_STARTED:
print("livestream started")

case .LIVESTREAM_STOPPING:
print("livestream stopping")

case .LIVESTREAM_STOPPED:
print("livestream stopped")

@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