Live UIKit Android v1
Live UIKit Android
Live UIKit
Android
Version 1

View a live event

Copy link

You can use the LiveEventParticipantActivity class to build a view for users to participant a live event. A LiveEventParticipantActivity instance can be used to display the host’s media stream, and a chat where the host and participants can send messages.


Component

Copy link

OverlayView

Copy link

The overlay view component shows the buttons that control live event media. You will be able to Exit. When live event is starts, the middle view of the top section shows the duration of the live event

Live event view

Copy link

The live event view component shows a livestreaming that the host is broadcasting at the moment.


Sendbird Live UIKit for Android provides both activity and fragment to create a live event list screen. You can choose which one to build your app with and you may solely use activity instead of fragment if you wish to. You can build a live event list screen through LiveEventParticipantActivity, which uses LiveUIKitFragmentFactory to create views.

Start an activity

Copy link

You can start an activity by using intent to move from one activity to LiveEventParticipantActivity as shown below:

val intent = LiveEventParticipantActivity.newIntent(context, liveEventId);
startActivity(intent);

Create a fragment

Copy link

LiveEventParticipantActivity allows you to create a basic LiveEventParticipantFragment through LiveUIKitFragmentFactory and LiveEventParticipantFragment.Builder. LiveUIKitFragmentFactory has a set of methods that build each fragment, whereas the builder class provides APIs to customize the UI of the data and event handlers used in LiveEventParticipantFragment.

val fragment = LiveEventParticipantFragment.Builder(liveEventId).build();

Customization

Copy link

In the live event participant key function, you can customize LiveEventParticipantFragment to change different aspects of the screen. The LiveEventParticipantFragment.Builder class allows you to create and customize the basic LiveEventParticipantFragment that the Live UIKit provides but you can only change its own APIs, such as setting a layout. If you wish to customize the fragment beyond using the APIs provided in the builder, you must inherit new customization methods.

The following table shows the main classes used in LiveEventParticipantFragment to display and customize the live event participant screen.

FragmentStyle

LiveEventParticipantFragment

Widget.SendbirdLive.LiveEventOverlayView

Widget.SendbirdLive.SetupItemView

Widget.SendbirdLive.LiveEventView

Widget.SendbirdLive.LiveEventEmptyView

String resource

Copy link

The following table lists some of the text strings that you can customize to modify the participant live event view. To see a full list, see String resource.

<resources>
    <string name="sb_live_live_event_ended_description">Live event has ended.</string>
    <string name="sb_live_live_event_enter_alert_created_state_description">This live event will open soon.</string>
    <string name="sb_live_live_event_enter_alert_description">You cannot enter events that are in the %s state.</string>
    <string name="sb_live_live_event_live_banner_host_muted_description">Host is muted.</string>
    <string name="sb_live_live_event_live_banner_host_unavailable_description">Host is temporarily unavailable.</string>
    <string name="sb_live_live_event_ready_banner_description">Live event will begin soon.</string>
    <string name="sb_live_participant_count_affix">%s participants</string>
</resources>

Icon resource

Copy link

The following table lists some of the icons that you can customize to modify the participant live event view. To see a full list, see Icon resource.

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.