Live UIKit iOS v1
Live UIKit iOS
Live UIKit
iOS
Version 1

Participate in a live event

Copy link

You can participate in a live event as a participant. When you enter a live event as a participant, you can receive the host's media stream and chat with other participants and the host.

A LiveEventParticipantViewController instance includes a view displaying the host's media stream, UI components for providing the live event information, and a chat where participants can send messages during the live event.

List of features

Copy link

The following table lists the features included in LiveEventParticipantViewController. The LiveEventParticipantViewController class includes all the features of the LiveEventViewController class and can access all of its methods and properties.

FeatureDescription

Enter a live event

Allows a user to enter a live event.

Use the chat

Allows a user to send messages to the chat.

Show a list of participants

Displays a list of participants watching the live event.


Initialize

Copy link

To launch LiveEventParticipantViewController, a user must enter the live event by calling liveEvent.enterEvent.

A user can click a live event on LiveEventListViewController to enter the live event and automatically display LiveEventParticipantViewController.

Alternatively, you can use the following code to manually display LiveEventParticipantViewController.

liveEvent.enter { error in
    guard error == nil, liveEvent.openChannel != nil else { return }

    let participantVC = LiveEventParticipantViewController(openChannel: liveEvent.openChannel!, liveEvent: liveEvent)
    self.present(participantVC)
}

Customization

Copy link

UI Customization

Copy link

The following table lists methods you can use to customize the view controller.

Method nameDescription

showDuration

Determines whether to display the duration of a live event in the view. If set to true, displays the duration of a live event. (Default: true)

showLiveEventStatus

Determines whether to display the live event status in the view. If set to true, displays the live event status. (Default: true)

showParticipantCount

Determines whether to display the number of participants in real time. If set to true, displays the number of views. (Default: true)

endedLiveEventViewDisplayTime

The period of time to display the message that the live event has ended.

onEndLiveEventClicked

Called when a user clicks the exit button. By default, a host is given a choice to end or leave without ending the live event while a participant is prompted to leave the live event.

String set

Copy link

The following table lists the properties of SBUStringSet you can customize to modify the live event's participant view.

CategoryKeyString

LiveEvent

disconnectedAlertTitle

Disconnected temporarily

LiveEvent

disconnectedAlertDescription

Try entering the live event again.

ParticipantView

liveEventEndedDescription

Live event has ended.

ParticipantView

liveEventLiveBannerHostMutedDescription

Host is muted.

ParticipantView

liveEventLiveBannerHostUnavailableDescription

Host is temporarily unavailable.

ParticipantView

liveEventReadyBannerDescription

Live event will begin soon.

ParticipantView

participantListHeaderTitle

Participants

Icon set

Copy link

The following table lists icons in SBUIconSet that you can customize to modify the live event's participant view.

IconImageDescription

ICON_CAMERA_SWITCH

Switches between front and rear cameras.

ICON_AUDIO_ON

Indicates that audio device is turned on.

ICON_AUDIO_OFF

Indicates that audio device is turned off.

ICON_VIDEO_ON

Indicates that a video device is turned on.

ICON_VIDEO_OFF

Indicates that a video device is turned off.