Guide to Interactive streaming

This guides explains you on how to build interactive live streaming apps via conferencing SDK.

Generate an API Key for your project

  1. Generate a Bearer Token

  2. Creating a Conference Room

  3. Alternative to Creating a Conference Room

  4. Start Live Streaming

  5. Stop Live Streaming

  6. Streaming to Multiple Outlets

Generate API Key

You can generate your API key for your project by visiting console.sariska.io and signing up.

The full instruction on how to do it can be found here: Link

Generate a Bearer Token

We generate these authentication tokens on our own servers. You can use the same token for all the services offered by Sariska.

To generate a token, follow the instruction on the page here

“user” data in the above curl command is optional and the bearer token is generated regardless of it.

Creating a Conference Room for Your Live Stream

In order to start a multi host live stream, all the hosts need to join a common room. The name for this common room can be anything the hosts choose to. This part details on how to create a simple conference for your hosts to live stream.

Installation:

The first step is to install the sariska-media-transport library by running the following command in your project directory using NPM.

Initialise SDK:

After installing the SDK, perform initial setup tasks by running initialize().

Create Connection:

To establish a connection, you would need to generate a token. You’d also need to specify a room name, this is the room your hosts will join to live stream together.

Create Conference:

Once you have your connection established, the next step is to create a conference.

Now, the conferenceobject will have all events and methods that you would possibly need for any feature that you wish to supplement your application with.

Capture local streams:

A MediaStream consists of zero or more MediaStreamTrack objects, representing various audio or video tracks. Each MediaStreamTrack may have one or more channels. The channel represents the smallest unit of a media stream, such as an audio signal associated with a given speaker, like left or right in a stereo audio track. Here we mostly talk about track.

Play Local stream:

User Joined:

The moderator of the meeting controls and gate keeps the participants. The moderator has exclusive control of the meeting.

Publish your stream to other peers:

Playing remote peers streams:

Alternative to Creating a Conference Room

If you’d like to quickly test the live streams without having to create a conference, you can use Sariska’s meet application.

let’s say the room name for our case is “streamtest”. Since we are using Sariska’s meet app to run this demo, you can go to meet.sariska.io/streamtest

Start Live Streaming

With Sariska, starting a live stream is just a simple API call away. Generate another bearer token and then follow the curl command.

For example, the curl command will look something like this for a room “streamtest”.

The sample response for such a request will be

Stop Live Streaming

Sample Response:

Streaming To Multiple Outlets

If you’d like to stream to platforms such as Youtube, Facebook, or Twitch. You can send a request like shown below.

  • streamKeys (optional): Streaming keys for all the platforms you want to stream at

  • streamUrls (optional): RTMP Url Endpoints

  • is_recording (optional): Flag to state if you’d like to record the meeting

  • is_vod (optional): Flag to state if you’d like to provide this stream as a VOD

  • audio_only (optional): Flag true if you’d like it to be an audio only stream

For detailed information, please refer to the Swagger documentation.

Last updated