Watching a Livestream

This guide describes how to watch a livestream using our SDK.

  • Read our tutorial for more info on how to implement livestreaming host and viewer apps.
  • Go to the HLS section of our tutorial to find out how to view a HLS livestream.

If you want to watch a WebRTC livestream, then you can either use our LivestreamPlayer, or build your own component.

LivestreamPlayer UI component

The LivestreamPlayer component shows the following information:

  • live indicator
  • number of participants
  • duration
  • pause/resume on tap functionality
  • mute/unmute incoming sound

Basic usage

For standard usage, you just need to pass a call object:

LivestreamPlayer(call = call)

watching-livestream-1.png

Customization

This is the full signature of the component:

@Composable
public fun LivestreamPlayer(
    modifier: Modifier = Modifier,
    call: Call,
    enablePausing: Boolean,
    onPausedPlayer: ((isPaused: Boolean) -> Unit)?,
    backstageContent: @Composable BoxScope.(Call) -> Unit,
    rendererContent: @Composable BoxScope.(Call) -> Unit,
    overlayContent: @Composable BoxScope.(Call) -> Unit
)
  • modifier: Used to apply styling to the component, such as extra borders, background, elevation, size or shape and more.
  • call: The livestream call to watch.
  • enablePausing: Controls the pause/resume on tap functionality.
  • onPausedPlayer: Event handler for the pause/resume on tap event.
  • backstageContent: Content to show when the call is in backstage mode (i.e. the host has not started the livestream yet)
  • rendererContent: Used to control how the video feed is rendered on screen. By default, it uses the VideoRenderer component under the hood.
  • overlayContent: Used for customizing the overlay that contains participant count, duration and other info.
© Getstream.io, Inc. All Rights Reserved.