Skip to main content

Livestreaming API Integration Guide

Dyte Livestreaming adds live video and voice interactive streaming to any online experience. It provides complete control over the streaming experience, from a simple one-to-many stream to a highly interactive live event.

Dyte allows livestreaming, via RTMP as well as HLS, for all Dyte meetings. If you want us to manage the output to RTMP instead, check this doc instead.

Dyte Livestreaming provides two modes of operations:

  1. Livestreaming Independently
  2. Livestreaming a Meeting

These modes help you manage various livestream usecases. Let’s understand what both of these mean:

  • Livestreaming Independently: If you want to control what you stream and how it is distributed, this is the way to go. Individual ingest URLs can be created for ingesting a livestream from apps like OBS, ffmpeg, and others, as well as playback URLs to play it in your preferred player.

  • Livestreaming a Meeting: If you want to stream a meeting to a large number of people, this is an excellent option. Dyte provides APIs to automatically start livestreaming a meeting, as well as an SDK player that allows users to watch the livestream in high quality. For example, livestream a meeting for an events platform, a virtual workspace to host large events such as hackathons, conferences, or even your own metaverse party.

Livestreaming independently

Run the following command to generate credentials for a new independent livestream.

  • Request
curl --request POST \
--url https://api.cluster.dyte.in/v2/livestreams \
--header 'Authorization: Basic <token>' \
--header 'Content-Type: application/json'
  • Response
{
"success": true,
"data": {
"status": "OFFLINE",
"name": "Livestreaming-Demo",
"meeting_id": null,
"ingest_seconds": 0,
"viewer_seconds": 0,
"ingest_server": "rtmps://2ec80asdf2dd47b0.global-contribute.live-video.net:443/app/",
"id": "78dd0b50-4147-4bb8-88d3-2ccc2e98bff0",
"stream_key": "sk_ap-south-1_BSErwBSdrcWn_0eGage01cFGCJcRcCsflOAX3Eu4B3RyRX",
"playback_url": "https://2ec80asdf2dd47b0.ap-south-1.playback.live-video.net/api/video/v1/ap-south-1.944908621410.channel.Jk1l97eJF0ME.m3u8"
}
}

Livestreaming a meeting

Run the following command to start livestreaming a meeting.

  • Request
curl --request POST \
--url https://api.cluster.dyte.in/v2/meetings/{meetingId}/livestreams \
--header 'Authorization: Basic <token>' \
--header 'Content-Type: application/json'
  • Response
{
"success": true,
"data": {
"status": "OFFLINE",
"name": null,
"meeting_id": "188566bc-8770-4ca0-9eb3-24b594ecaf7e",
"ingest_server": "rtmps://2ec802dd47b0.global-contribute.live-video.net:443/app/",
"id": "7088bba8-f522-49a8-b59b-3cd0e946bbb0",
"stream_key": "sk_ap-south-1_AfnVpeYZjidO_fBpWKody7sDUOEfy9Zc6XAZegkR0Va",
"playback_url": "https://2ec802dd47b0.ap-south-1.playback.live-video.net/api/video/v1/ap-south-1.944908621410.channel.rVKA2KM5Lunt.m3u8"
}
}

Run the following command to get active livestream for a meeting.

  • Request
curl --request GET \
--url https://api.cluster.dyte.in/v2/meetings/{meetingId}/active-livestream \
--header 'Authorization: Basic <token>' \
--header 'Content-Type: application/json'
  • Response
{
"success": true,
"data": {
"status": "LIVE",
"name": null,
"meeting_id": "188566bc-8770-4ca0-9eb3-24b594ecaf7e",
"ingest_seconds": 0,
"viewer_seconds": 0,
"ingest_server": "rtmps://2ec802dd47b0.global-contribute.live-video.net:443/app/",
"id": "7088bba8-f522-49a8-b59b-3cd0e946bbb0",
"stream_key": "sk_ap-south-1_AfnVpeYZjidO_fBpWKody7sDUOEfy9Zc6XAZegkR0Va",
"playback_url": "https://2ec802dd47b0.ap-south-1.playback.live-video.net/api/video/v1/ap-south-1.944908621410.channel.rVKA2KM5Lunt.m3u8"
}
}

Run the following to stop livestreaming a meeting.

  • Request
curl --request POST \
--url https://api.cluster.dyte.in/v2/meetings/meetingId/active-livestream/stop \
--header 'Authorization: Basic <token>' \
--header 'Content-Type: application/json'
  • Response
{
"success": true,
"data": {
"message": "livestream stopped"
}
}

To learn more about the Dyte livestreaming APIs, see Livestreaming APIs.

Getting Authentication Token

The Add Participant API call returns your authentication token. See Add a participant. Room name is generated when you create a meeting. You can get the room name from the developer portal or using REST APIs. For more information, see Create a meeting.