StreamLayer

Use this class as an entry point for StreamLayer SDK.

Properties

Link copied to clipboard

A available locales in the sdk

Link copied to clipboard

Functions

Link copied to clipboard
fun activeWatchPartyIdState(): StateFlow<String?>

A function to get id of active watch party of the StreamLayer SDK.

Link copied to clipboard
fun addCustomOverlays(overlay: Array<SLRCustomOverlay>)

Function to add a custom overlay to the StreamLayer SDK.

Link copied to clipboard
suspend fun authorizationBypass(schema: String, token: String)

Called when you want to login for the StreamLayer SDK session.

Link copied to clipboard

A function to close StreamLayer SDK active watch party.

Link copied to clipboard
suspend fun createEventSession(eventId: String, timeCodeProvider: SLRTimeCodeProvider?): SLREventSession

The StreamLayer SDK supports event by event configuration. After the StreamLayer SDK has been initialized, call this method at least once to fetch the current active configuration. Every time the current event occurs, this method should be called with a new event id to fetch the relevant configuration.

Link copied to clipboard
suspend fun createManagedGroupSession(groupId: String, title: String?): SLRManagedGroupSession

The StreamLayer SDK supports subscription to the managed group.

Link copied to clipboard
fun handleDeepLink(intent: Intent, activity: FragmentActivity): Boolean

This function processes the StreamLayer deep link. The function parses the StreamLayerFragment in your activity and launch the appropriate overlay.

Link copied to clipboard
fun handleInvite(data: SLRInviteData, context: Context)

This function handles the StreamLayer invite link.

Link copied to clipboard
fun handlePush(context: Context, data: Map<String, String>): Boolean

When a push receives a push message, this function will process the notification and display it to the user. Add this function to your FirebaseMessagingService in FirebaseMessagingService.onMessageReceived to enable the StreamLayer SDK to intercept push notifications.

Link copied to clipboard
fun initializeApp(context: Context, sdkKey: String)

Initializes the application and creates a dependency injection tree. This method within the onCreate() method of your application or at least before the screen that uses the StreamLayerFragment or StreamLayerLiteFragment.

Link copied to clipboard
fun isManagedGroup(watchPartyId: String): Boolean

A function to compare watch party id with managed watch party.

Link copied to clipboard
fun isUserAuthorized(): Boolean

Returns whether the user is authorized in the StreamLayer SDK session.

Link copied to clipboard
fun isWatchPartySupported(): Boolean

A function to check if StreamLayer SDK Watch party is supported on device.

Link copied to clipboard
suspend fun logout()

Called when you want to logout for the current StreamLayer SDK session.

Link copied to clipboard
fun openActiveWatchParty(context: Context, intent: Intent? = null)

A function to open StreamLayer SDK active watch party.

Link copied to clipboard

Sends a custom notification to the host app.

Link copied to clipboard
Link copied to clipboard

Set custom theme for SDK.

Link copied to clipboard
fun setGamificationOptions(isGlobalLeaderboardEnabled: Boolean, isInvitesEnabled: Boolean)

A function to change gamification data options.

Link copied to clipboard
fun setLogcatLoggingEnabled(isEnabled: Boolean)

The StreamLayer SDK has an internal Logcat function that could be enabled / disabled by this function. By default, logging is enabled.

Link copied to clipboard

A function to register the listener invoked when StreamLayer SDK needs to log any message or error.

Link copied to clipboard
fun setPhoneContactsOptions(isUiEnabled: Boolean, isSyncEnabled: Boolean)

If you want to disable phone contacts ui or sync, the host app needs to set these flags to false with this function.

Link copied to clipboard
fun setStatisticsDataOptions(fetchUrl: String, refreshIntervalInMillis: Long)

A function to change statistics data fetching options.

Link copied to clipboard

A function to register the SLRVideoPlayerProvider which invoked when a video playback has been requested.

Link copied to clipboard
fun setWatchPartyOptions(isPublicWpEnabled: Boolean, isWpHistoryEnabled: Boolean, isCreateSoloWpEnabled: Boolean)

If you want to disable watch party history ui or public watch party feature, the host app needs to set these flags to false with this function.

Link copied to clipboard
fun uploadDeviceFCMToken(context: Context, token: String, forceUpdate: Boolean = true)

To enable push messages from the StreamLayer service, you need to upload the device token to register it with the current user. Upload the token every time when the token changes. This function should be in your FirebaseMessageService.onNewToken callback.

Link copied to clipboard
suspend fun useAnonymousAuth()

Called when you want to login for the StreamLayer SDK session as anonymous user.

Link copied to clipboard
fun userIsAuthorizedState(): Flow<Boolean>

A function which provides subscription to the user is authorized updates.

Link copied to clipboard

A function to change options of the current StreamLayerFragment host.