SARISKA
  • Introduction
  • Overview
  • Getting Started
    • Get API Key
    • Authentication
  • Real Time Messaging
    • Overview
    • Development
      • JavaScript
      • Swift
      • Kotlin
      • Java
      • Dart
      • C# (Unity Engine)
    • API References - Real Time Messaging
  • Video Calling/ Video Conferencing Api
    • Overview
    • Development
      • JavaScript
      • Swift
      • Kotlin
      • Java
      • Flutter (Dart)
      • C# (Unity Engine)
      • C++ (Unreal Engine)
    • API References - Video Calling
      • Video Calling CDR API's
      • Conference Scheduling Reservation APIs
  • Co-Browsing
    • Overview
    • Javascript
  • Server
    • Pub/Sub Node.js environment
  • Project Management
    • Pricing And Billing
    • Quotas and Limits
  • SDK
    • Mobile
      • Video Calling Mobile Apps
      • Messaging Mobile Apps
    • Desktop
      • Video Calling Desktop Apps
      • Messaging Desktop Apps
    • Browser
      • Video Calling Browser Apps
      • Messaging Browser Apps
      • Co-browsing Browser Apps
  • UI Kit
    • Generating the API Key for your Project
    • Video Conferencing
      • Running Sariska's Unity Demo
        • Android
      • Unity Engine
      • Unreal Engine
    • Audio Conferencing
  • Live Streaming
    • Interactive Live Streaming
    • Non-Interactive Live Streaming
    • API References - Live Streaming
      • API Reference - Interactive Live Streaming
      • API Reference - Non-Interactive Live Streaming
    • Guide to Interactive streaming
  • Sariska Analytics
    • Overview
Powered by GitBook
On this page
Export as PDF
  1. Live Streaming
  2. API References - Live Streaming

API Reference - Interactive Live Streaming

This page describes the API references for interactive live streaming.

Last updated 1 year ago


Table of Contents


  1. Generate JWT Token

  1. Start Live Streaming

  1. Stop Live Streaming

  1. Get Live Viewers Count

  1. Get Live Viewers Count for Low Latency HLS

Generate JWT Token
Start Live Streaming
Stop Live Streaming
Get Live Viewers Count
Get Live Viewers Count for Low Latency Live Streaming

Get all live viewers count

get
Path parameters
stream_namestringRequired
Responses
200
A generated response for fetching live hls users count
application/json
get
GET /terraform/v1/hooks/srs/live/viewers/count/{stream_name} HTTP/1.1
Host: api.sariska.io
Accept: */*
200

A generated response for fetching live hls users count

{
  "{stream_name}": {
    "current_viewers": 1,
    "uptime": 1
  }
}

Get all live viewers count with low latency HLS URL

get
Path parameters
stream_namestringRequired
Responses
200
A generated response for fetching live hls users count
application/json
get
GET /llhls/v1/hooks/srs/live/viewers/count/{stream_name} HTTP/1.1
Host: api.sariska.io
Accept: */*
200

A generated response for fetching live hls users count

{
  "{stream_name}": {
    "current_viewers": 1,
    "uptime": 1
  }
}
  • Table of Contents
  • POSTGenerate JWT Token to use with sariska services
  • POSTStarts new live streaming
  • POSTStops already started live streaming
  • GETGet all live viewers count
  • GETGet all live viewers count with low latency HLS URL

Generate JWT Token to use with sariska services

post
Body
apiKeystringOptional

please pass apiKey with tied with your sariska account

Example: iufwenufewifweifiuTbddhbdjhjfbjfjwfjwfj
expstringOptional

pass exp claim of jwt token

Example: 24 hours
nbfstringOptional

pass nbf claim of jwt token

scopestringOptional

pass scope of token it can be messaging or media or sariska or leave it blank

Responses
200
A successfully generated response for jwt token
application/json
401
Failed to generate token
application/json
post
POST /api/v1/misc/generate-token HTTP/1.1
Host: api.sariska.io
Content-Type: application/json
Accept: */*
Content-Length: 219

{
  "apiKey": "iufwenufewifweifiuTbddhbdjhjfbjfjwfjwfj",
  "user": {
    "id": "ytyVgh",
    "name": "Nick",
    "email": "nick@gmail.com",
    "avatar": "https://some-storage-location/nick.jpg",
    "moderator": false
  },
  "exp": "24 hours",
  "nbf": "",
  "scope": ""
}
{
  "token": "text"
}

Starts new live streaming

post
Authorizations
Body
stream_urlsstring[]Optional

This is a list of additional RTMP URLs for platforms not included in the above-listed platforms or host URL is dynamic

room_namestringOptional

The room name recorder needs to join.

Example: room1234
is_low_latencybooleanOptional

Whether the live streaming needs to be in low latency

Example: true
codecstringOptional

The player side codec default is H264

Example: H265
is_recordingbooleanOptional

Please set this flag to true if you want MP4 recordings of the live stream.

Example: true
multi_bitratebooleanOptional

If true is passed, the stream will be transcoded into 5 different variants: 720p (HD), 480p (HD_MID), 360p (MID), 240p (MID_LOW), and 240p (LOW) with bitrates of 2628kbps, 1128kbps, 878kbps, 528kbps, and 264kbps, respectively. This will ensure the best possible viewing experience, regardless of the user's network or device.

Example: true
is_vodbooleanOptional

Please set this flag to true if you want to access the Video on Demand (VOD) URL. The VOD will be available after the live streaming has finished.

Example: true
usernamebooleanOptional

Please set this flag to true if you want the participant name to appear in the video tiles.

Example: true
audio_onlybooleanOptional

Please set this flag to true if you want the streaming to be audio-only.

Example: true
layoutstringOptional

By default, the live streaming layout is optimized for desktop. If you want it to be optimized for mobile, you can pass the flag mobile

Example: mobile
profilestringOptional

By default, adaptive bitrate streaming is enabled between the videobridge and recorder for each participant's stream. However, if you want to record and stream each participant's original quality, you can pass the flag as HD

Example: HD
reconnect_windownumberOptional

The default time interval for the recorder is 1 minute. If a different time interval is set, the recorder will remain active for that duration, and if all participants leave before the interval ends, a new streaming API call must be made to restart the recording.

Example: 6000 equivalent to 1 min
Responses
200
A generated response after live streaming started successfully
application/json
400
Bad request
application/json
401
Authenticatin token has expired
application/json
422
Not able to process your http request
application/json
502
Server crash
application/json
504
Failed to start streaming within 30 seconds of time , if you receive this request then you can resend the request again.
application/json
post
POST /terraform/v1/hooks/srs/startRecording HTTP/1.1
Host: api.sariska.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 584

{
  "stream_keys": [
    {
      "key": "youtube",
      "value": "youtube_stream_key"
    },
    {
      "key": "facebook",
      "value": "facebook_stream_key"
    },
    {
      "key": "twitch",
      "value": "twitch_stream_key"
    },
    {
      "key": "vimeo",
      "value": "vimeo_stream_key"
    },
    {
      "key": "instagram",
      "value": "instagram_stream_key"
    }
  ],
  "stream_urls": [
    "rtmp://linkedin.{dynamic-secret}.rtmp.url, rtmp://microsoft.{dynamic-secret}.rtmp.url"
  ],
  "room_name": "room1234",
  "is_low_latency": true,
  "codec": "H265",
  "is_recording": true,
  "multi_bitrate": true,
  "is_vod": true,
  "username": true,
  "audio_only": true,
  "layout": "mobile",
  "profile": "HD",
  "reconnect_window": "6000 equivalent to 1 min"
}
{
  "started": true,
  "stream_name": "text",
  "pod_name": "text",
  "hls_url": "text",
  "low_latency_hls_url": "text",
  "vod_url": "text",
  "rtmp_url": "text",
  "flv_url": "text"
}

Stops already started live streaming

post
Authorizations
Body
room_namestringOptional

stops streaming of given room name

Example: room1234
Responses
200
A generated response for successfully stopped streaming
application/json
400
Bad request
application/json
401
Authenticatin token has expired
application/json
422
Not able to process your http request
application/json
502
Server crash
application/json
504
Failed to stop streaming within 30 seconds of time , if you receive this request then you can resend the request again.
application/json
post
POST /terraform/v1/hooks/srs/stopRecording HTTP/1.1
Host: api.sariska.io
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "room_name": "room1234"
}
{
  "started": false
}