ClickCease Tracking
<greylight>
Copy
Custom live streaming platform

How to build quick Livestream connections

Italo Orihuela
Engineer
Android
iOS
Web
Jul 28, 2023

In today's virtual landscape, live streaming has become an indispensable tool for hosting events and fostering real-time community interactions. Whether it's a product launch, a live Q&A session, or a virtual event, live streaming offers a dynamic and engaging experience for both the host and the audience. In this tutorial, we will guide you through the process of integrating live streaming features into your application using Amity Social Cloud, a platform designed to make it easy for developers to add social features to their apps. By the end of this guide, you will be able to set up your application for live streaming, create and manage live stream events, and provide a seamless live streaming experience for your users.

Pre-requisites

To use the live-stream feature, you'll need to:

  1. Install our Video SDK.
  2. Have access to a Pro plan or higher.

Otherwise, contact us for specific plan options to meet your application's needs.

Step 1: Set up your Application

Before you can start streaming, you'll need to set up your application. Here's a step-by-step breakdown of the initial setup:

  1. Create an Amity Account: If you don't already have one, start by creating an account on the Amity Portal.
  2. Create a new network or app: In the Amity Portal, create a new network and start adding your users (or use an existing one).
  3. Install the Video SDK: Follow the instructions provided by Amity Social Cloud to install and set up the Video SDK in your application. SDK install docs can be found here.

Note: Having the Pro plan or higher is necessary to unlock the live streaming feature.

Step 2: Create and Manage Live Stream Events

Once your application is set up, you can start creating live stream events. To create a live stream using the Amity Social Cloud API, you'll need to make a POST request to the API endpoint with the necessary parameters. The parameters include:

  • title: The title of the stream.
  • description: A brief description of the stream.
  • thumbnailFileId: The ID of the file to use as the thumbnail for the stream.
  • isSecure: A boolean value indicating whether the stream requires authentication to view.

Step 3: Start and End the Stream

After creating a live stream, you will be able to start publishing it. To publish a live stream, you'll use the Broadcaster component of the Amity Video SDK.

To end the live stream, you'll use the StreamRepository to dispose of the stream:

Step 4: Observing and Displaying Active Live Streams

To display all live streams or a specific stream to your users, you can use the StreamRepository's observeStreams or getStreamById method:

Step 5: Player Live Streams

To watch a live stream, users can use the Player component provided by the Amity Video SDK. This component allows users to view a live stream in real time. The Player component takes a streamId as a prop, which is the ID of the live stream the user wants to watch.

Final Thoughts

By following these steps, you can effectively integrate live streaming capabilities into your application. Live streaming is a powerful tool that can significantly enhance user engagement and create a more dynamic and interactive user experience. Whether you're hosting virtual events, product launches, or community gatherings, the Amity Social Cloud's live streaming feature offers a robust solution that is both easy to implement and use.

With these easy-to-follow steps, you'll be able to stream your events seamlessly and engage with your community in real time using Amity Social Cloud. Happy live streaming!