/live-streams
Get the list of livestreams on the workspace.
streamKey
string
The unique stream key that allows you to stream videos.
name
string
You can filter live streams by their name or a part of their name.
sortBy
string
Enables you to sort live stream results. Allowed attributes: name
, createdAt
, updatedAt
.
name
- the name of the live stream.
createdAt
- the time a live stream was created.
updatedAt
- the time a live stream was last updated.
When using createdAt
or updatedAt
, the API sorts the results based on the ISO-8601 time format.
sortOrder
string
Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.
currentPage
int
Choose the number of search results to return per page. Minimum value: 1
pageSize
int
Results per page. Allowed values 1-100, default is 25.
apiKey
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Success
data
array[object (LiveStream)]
required
LiveStream
object (LiveStream)
liveStreamId
string
required
The unique identifier for the live stream. Live stream IDs begin with "li."
name
string
The name of your live stream.
streamKey
string
The unique, private stream key that you use to begin streaming.
public
boolean
Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here.
assets
object (assets)
hls
string
The http live streaming (HLS) link for your live video stream.
iframe
string
The embed code for the iframe containing your live video stream.
player
string
A link to the video player that is playing your live stream.
thumbnail
string
A link to the thumbnail for your video.
playerId
string
The unique identifier for the player.
broadcasting
boolean
Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.
restreams
array[object (Restreams response object)]
required
Returns the list of restream destinations.
Restreams response object
object (Restreams response object)
name
string
Returns the name of a restream destination.
serverUrl
string
Returns the server URL of a restream destination.
streamKey
string
Returns the unique key of the live stream that is set up for restreaming.
createdAt
string
When the player was created, presented in ISO-8601 format.
updatedAt
string
When the player was last updated, presented in ISO-8601 format.
pagination
object (pagination)
required
itemsTotal
int
Total number of items that exist.
pagesTotal
int
Number of items listed in the current page.
pageSize
int
Maximum number of item per page.
currentPage
int
The current page index.
currentPageItems
int
The number of items on the current page.
links
array[object (PaginationLink)]
required
PaginationLink
object (PaginationLink)
rel
string
uri
string
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#list
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
req := apivideosdk.LiveStreamsApiListRequest{}
req.StreamKey("30087931-229e-42cf-b5f9-e91bcc1f7332") // string | The unique stream key that allows you to stream videos.
req.Name("My Video") // string | You can filter live streams by their name or a part of their name.
req.SortBy("createdAt") // string | Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`.
req.SortOrder("desc") // string | Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.
req.CurrentPage(int32(2)) // int32 | Choose the number of search results to return per page. Minimum value: 1 (default to 1)
req.PageSize(int32(30)) // int32 | Results per page. Allowed values 1-100, default is 25. (default to 25)
res, err := client.LiveStreams.List(req)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.List``: %v\
", err)
}
// response from `List`: LiveStreamListResponse
fmt.Fprintf(os.Stdout, "Response from `LiveStreams.List`: %v\
", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#list
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
// retrieve the first page of all livestreams
const liveStreams = await client.liveStreams.list({ });
// retrieve the livestreams having a given name
const liveStreams2 = await client.liveStreams.list({
name: 'My livestream'
});
// retrieve the livestreams having a given stream key
const liveStreams2 = await client.liveStreams.list({
streamKey:'30087931-229e-42cf-b5f9-e91bcc1f7332'
});
// retrieve the second page of 30 items sorted by name desc
const liveStreams3 = await client.liveStreams.list({
sortBy: 'name',
sortOrder: 'desc',
currentPage: 2,
pageSize: 30
});
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#list
import apivideo
from apivideo.api import live_streams_api
from apivideo.model.live_stream import LiveStream
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = live_streams_api.LiveStreamsApi(api_client)
live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream you want to watch.
# example passing only required values which don't have defaults set
try:
# Show live stream
api_response = api_instance.get(live_stream_id)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling LiveStreamsApi->get: %s\n" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#list
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
LiveStreamsApi apiInstance = client.liveStreams();
String streamKey = "30087931-229e-42cf-b5f9-e91bcc1f7332"; // The unique stream key that allows you to stream videos.
String name = "My Video"; // You can filter live streams by their name or a part of their name.
String sortBy = "createdAt"; // Enables you to sort live stream results. Allowed attributes: `name`, `createdAt`, `updatedAt`.
String sortOrder = "desc"; // Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones. For title, it is 0-9 and A-Z ascending and Z-A, 9-0 descending.
Integer currentPage = 1; // Choose the number of search results to return per page. Minimum value: 1
Integer pageSize = 25; // Results per page. Allowed values 1-100, default is 25.
try {
Page<LiveStream> result = apiInstance.list()
.streamKey(streamKey)
.name(name)
.sortBy(sortBy)
.sortOrder(sortOrder)
.currentPage(currentPage)
.pageSize(pageSize)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LiveStreamsApi#list");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#list
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class getExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique ID for the live stream you want to watch.
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Show live stream
LiveStream result = apiLiveStreamsInstance.get(liveStreamId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.get: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#list
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
// retrieve the first page of all livestreams
$liveStreams = $client->liveStreams()->list();
// retrieve the livestreams having a given name
$liveStreams2 = $client->liveStreams()->list(array(
'name' => 'My livestream'
));
// retrieve the livestreams having a given stream key
$liveStreams2 = $client->liveStreams()->list(array(
'streamKey' => '30087931-229e-42cf-b5f9-e91bcc1f7332'
));
// retrieve the second page of 30 items sorted by name desc
$liveStreams3 = $client->liveStreams()->list(array(
'sortBy' => 'name',
'sortOrder' => 'desc',
'currentPage' => 2,
'pageSize' => 30
));
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#list
Success
{
"data": [
{
"liveStreamId": "li400mYKSgQ6xs7taUeSaEKr",
"createdAt": "2020-01-31T10:17:47.000Z",
"updatedAt": "2020-03-09T13:19:43.000Z",
"streamKey": "30087931-229e-42cf-b5f9-e91bcc1f7332",
"restreams": [
{
"name": "YouTube",
"serverUrl": "rtmp://youtube.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385188"
},
{
"name": "Twitch",
"serverUrl": "rtmp://twitch.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385188"
}
],
"name": "Live Stream From the browser",
"public": true,
"broadcasting": false,
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/live/li400mYKSgQ6xs7taUeSaEKr",
"hls": "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr.m3u8",
"thumbnail": "https://live.api.video/li400mYKSgQ6xs7taUeSaEKr/thumbnail.jpg"
}
},
{
"liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
"createdAt": "2020-07-29T10:45:35.000Z",
"updatedAt": "2020-07-29T10:45:35.000Z",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
"restreams": [
{
"name": "YouTube",
"serverUrl": "rtmp://youtube.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
},
{
"name": "Twitch",
"serverUrl": "rtmp://twitch.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
}
],
"name": "Live From New York",
"public": true,
"broadcasting": false,
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
"hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
"thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
}
}
],
"pagination": {
"currentPage": 1,
"currentPageItems": 19,
"pageSize": 25,
"pagesTotal": 1,
"itemsTotal": 19,
"links": [
{
"rel": "self",
"uri": "/live-streams?currentPage=1&pageSize=25"
},
{
"rel": "first",
"uri": "/live-streams?currentPage=1&pageSize=25"
},
{
"rel": "last",
"uri": "/live-streams?currentPage=1&pageSize=25"
}
]
}
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/live-streams
Creates a livestream object.
name
string
required
Add a name for your live stream here.
public
boolean
Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here.
playerId
string
The unique identifier for the player.
restreams
array[object (Restreams request object)]
Use this parameter to add, edit, or remove RTMPS
or RTMP
services where you want to restream a live stream. The list can only contain up to 5 destinations.
Restreams request object
object (Restreams request object)
Adding restream destinations is optional. However, if you set a restream destination, you must provide all attributes for each destination.
name
string
required
Use this parameter to define a name for the restream destination.
serverUrl
string
required
Use this parameter to set the RTMPS
or RTMP
server URL of the restream destination.
streamKey
string
required
Use this parameter to provide the unique key of the live stream that you want to restream.
apiKey
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Bad Request
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
problems
array[object (BadRequest)]
Returns any additional problems in the request in an array of objects.
BadRequest
object (BadRequest)
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Success
liveStreamId
string
required
The unique identifier for the live stream. Live stream IDs begin with "li."
name
string
The name of your live stream.
streamKey
string
The unique, private stream key that you use to begin streaming.
public
boolean
Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here.
assets
object (assets)
hls
string
The http live streaming (HLS) link for your live video stream.
iframe
string
The embed code for the iframe containing your live video stream.
player
string
A link to the video player that is playing your live stream.
thumbnail
string
A link to the thumbnail for your video.
playerId
string
The unique identifier for the player.
broadcasting
boolean
Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.
restreams
array[object (Restreams response object)]
required
Returns the list of restream destinations.
Restreams response object
object (Restreams response object)
name
string
Returns the name of a restream destination.
serverUrl
string
Returns the server URL of a restream destination.
streamKey
string
Returns the unique key of the live stream that is set up for restreaming.
createdAt
string
When the player was created, presented in ISO-8601 format.
updatedAt
string
When the player was last updated, presented in ISO-8601 format.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
{
"name": "Test live",
"playerId": "pl4f4ferf5erfr5zed4fsdd",
"restreams": [
{
"name": "YouTube",
"serverUrl": "rtmp://youtube.broadcast.example.com",
"streamKey": "dw-dew8-q6w9-k67w-1ws8"
},
{
"name": "Twitch",
"serverUrl": "rtmp://twitch.broadcast.example.com",
"streamKey": "dw-dew8-q6w9-k67w-1ws8"
}
]
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#create
// instantiate the client
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
liveStreamCreationPayload := apivideosdk.LiveStreamCreationPayload{}
liveStreamCreationPayload.SetName("My Live Stream Video") // Add a name for your live stream here.
liveStreamCreationPayload.SetPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it.
liveStreamCreationPayload.SetPlayerId("pl4f4ferf5erfr5zed4fsdd") // The unique identifier for the player.
liveStreamCreatePayload.SetRestreams([]RestreamsRequestObject{{Name: "My RTMP server", ServerUrl: "rtmp://my.broadcast.example.com/app", StreamKey: "dw-dew8-q6w9-k67w-1ws8"}}) // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
res, err := client.LiveStreams.Create(liveStreamCreationPayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Create``: %v", err)
}
fmt.Fprintf(os.Stdout, "Response from `LiveStreams.Create`: %v", res)
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#create
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const liveStreamCreationPayload = {
name: "My Live Stream", // Add a name for your live stream here.
_public: true, // Whether your video can be viewed by everyone, or requires authentication to see it.
playerId: "pl4f4ferf5erfr5zed4fsdd", // The unique identifier for the player.
restreams: [ // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
{
streamKey: "dw-dew8-q6w9-k67w-1ws8",
serverUrl: "rtmp://my.broadcast.example.com/app",
name: "My RTMP server",
},
],
};
const liveStream = await client.liveStreams.create(liveStreamCreationPayload);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#create
from apivideo.api.live_streams_api import LiveStreamsApi
from apivideo.model.live_stream_creation_payload import LiveStreamCreationPayload
from apivideo import AuthenticatedApiClient, ApiException
with AuthenticatedApiClient("YOUR_API_KEY") as api_client:
live_stream_creation_payload = LiveStreamCreationPayload(
name="My Live Stream Video",
public=True,
player_id="pl4f4ferf5erfr5zed4fsdd",
restreams=[
RestreamsRequestObject(
name="My RTMP server",
server_url="rtmp://my.broadcast.example.com/app",
stream_key="dw-dew8-q6w9-k67w-1ws8",
),
],
) # LiveStreamCreationPayload |
try:
live_stream = LiveStreamsApi(api_client).create(live_stream_creation_payload)
print(live_stream)
except ApiException as e:
print("Exception when calling LiveStreamsApi->create: %s" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#create
// instantiate the client
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
LiveStreamCreationPayload liveStreamCreationPayload = new LiveStreamCreationPayload();
liveStreamCreationPayload.setName("My Live Stream Video"); // Add a name for your live stream here.
liveStreamCreationPayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it.
liveStreamCreationPayload.setPlayerId("pl4f4ferf5erfr5zed4fsdd"); // The unique identifier for the player.
liveStreamCreationPayload.setRestreams(Collections.singletonList(new RestreamsRequestObject() // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
.name("My RTMP server")
.serverUrl("rtmp://my.broadcast.example.com/app")
.streamKey("dw-dew8-q6w9-k67w-1ws8")));
try {
LiveStream liveStream = client.liveStreams().create(liveStreamCreationPayload);
System.out.println(liveStream);
} catch (ApiException e) {
e.printStackTrace();
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#create
var apiVideoClient = new ApiVideoClient("YOUR_API_KEY");
var liveStreamCreationPayload = new LiveStreamCreationPayload()
{
name = "My Live Stream Video",
_public = true,
playerid = "pl4f4ferf5erfr5zed4fsdd",
restreams = new List<RestreamsRequestObject>(){
new RestreamsRequestObject(){name="My RTMP server", streamKey="dw-dew8-q6w9-k67w-1ws8", serverUrl="rtmp://my.broadcast.example.com/app" }
}
};
try
{
var liveStream = apiVideoClient.LiveStreams().create(liveStreamCreationPayload);
}
catch (ApiException e)
{
// Manage create error here
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#create
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
$liveStream = $client->liveStreams()->create((new \ApiVideo\Client\Model\LiveStreamCreationPayload())
->setName("My Live Stream Video") // Add a name for your live stream here.
->setPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it.
->setPlayerId("pl4f4ferf5erfr5zed4fsdd")); // The unique identifier for the player.
->setRestreams(array( // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
new RestreamsRequestObject(['name' => 'My RTMP server', 'serverUrl' => 'rtmp://my.broadcast.example.com/app', 'streamKey' => 'dw-dew8-q6w9-k67w-1ws8'])));
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#create
ApiVideoClient.apiKey = "YOUR_API_KEY"
let liveStreamCreationPayload = LiveStreamCreationPayload(
name: "My Live Stream Video",
_public: true,
playerId: "pl4f4ferf5erfr5zed4fsdd",
restreams: [RestreamsRequestObject(
name: "My RTMP server",
serverUrl: "rtmp://my.broadcast.example.com/app",
streamKey: "dw-dew8-q6w9-k67w-1ws8"
)]
)
LiveStreamsAPI.create(liveStreamCreationPayload: liveStreamCreationPayload) { liveStream, error in
if let liveStream = liveStream {
// Do something with the livestream
}
if let error = error {
// Manage create error here
}
}
Success
{
"liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
"createdAt": "2020-07-29T10:45:35.000Z",
"updatedAt": "2020-07-29T10:45:35.000Z",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
"restreams": [
{
"name": "YouTube",
"serverUrl": "rtmp://youtube.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
},
{
"name": "Twitch",
"serverUrl": "rtmp://twitch.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
}
],
"name": "Live From New York",
"public": true,
"broadcasting": false,
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
"hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
"thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
}
}
Bad Request
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "This value should not be blank.",
"name": "restreams[0][name]"
}
This error occurs when a field is empty in the restreams
array in your request.
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "This collection should contain 5 elements or less.",
"name": "restreams"
}
This error occurs when you set more than 5 restream destinations.
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "Missing app name: [rtmp|rtmps]://[host]/[app name].",
"name": "restreams[0][serverUrl]"
}
This error occurs when the app name is missing from serverURL
in the restreams
array.
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "This value should not be null.",
"name": "restreams[0][name]"
}
This error occurs when a field is sent as null
in the restreams
array in your request.
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid.",
"status": 400,
"detail": "RTMP URL should have the following format: [rtmp|rtmps]://[host]/[app name].",
"name": "restreams[0][serverUrl]"
}
This error occurs when the URL you set in serverURL
is not rtmps
or rtmp
.
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/live-streams/{liveStreamId}
Get a livestream by id.
liveStreamId
string
required
The unique ID for the live stream you want to watch.
apiKey
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Success
liveStreamId
string
required
The unique identifier for the live stream. Live stream IDs begin with "li."
name
string
The name of your live stream.
streamKey
string
The unique, private stream key that you use to begin streaming.
public
boolean
Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here.
assets
object (assets)
hls
string
The http live streaming (HLS) link for your live video stream.
iframe
string
The embed code for the iframe containing your live video stream.
player
string
A link to the video player that is playing your live stream.
thumbnail
string
A link to the thumbnail for your video.
playerId
string
The unique identifier for the player.
broadcasting
boolean
Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.
restreams
array[object (Restreams response object)]
required
Returns the list of restream destinations.
Restreams response object
object (Restreams response object)
name
string
Returns the name of a restream destination.
serverUrl
string
Returns the server URL of a restream destination.
streamKey
string
Returns the unique key of the live stream that is set up for restreaming.
createdAt
string
When the player was created, presented in ISO-8601 format.
updatedAt
string
When the player was last updated, presented in ISO-8601 format.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#get
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique ID for the live stream you want to watch.
res, err := client.LiveStreams.Get(liveStreamId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Get``: %v\
", err)
}
// response from `Get`: LiveStream
fmt.Fprintf(os.Stdout, "Response from `LiveStreams.Get`: %v\
", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#get
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream you want to retrieve.
const liveStream = await client.liveStreams.get(liveStreamId);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#get
import apivideo
from apivideo.api import live_streams_api
from apivideo.model.live_stream import LiveStream
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = live_streams_api.LiveStreamsApi(api_client)
live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream you want to watch.
# example passing only required values which don't have defaults set
try:
# Show live stream
api_response = api_instance.get(live_stream_id)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling LiveStreamsApi->get: %s\n" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#get
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
LiveStreamsApi apiInstance = client.liveStreams();
String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream you want to watch.
try {
LiveStream result = apiInstance.get(liveStreamId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LiveStreamsApi#get");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#get
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class getExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique ID for the live stream you want to watch.
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Show live stream
LiveStream result = apiLiveStreamsInstance.get(liveStreamId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.get: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#get
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream you want to retrieve.
$liveStream = $client->liveStreams()->get($liveStreamId);
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#get
Success
{
"liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
"createdAt": "2020-07-29T10:45:35.000Z",
"updatedAt": "2020-07-29T10:45:35.000Z",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
"restreams": [
{
"name": "YouTube",
"serverUrl": "rtmp://youtube.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
},
{
"name": "Twitch",
"serverUrl": "rtmp://twitch.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
}
],
"name": "Live From New York",
"public": true,
"broadcasting": false,
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
"hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
"thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
}
}
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/live-streams/{liveStreamId}
If you do not need a live stream any longer, you can send a request to delete it. All you need is the liveStreamId.
liveStreamId
string
required
The unique ID for the live stream that you want to remove.
apiKey
No Content
This response is empty
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#delete
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique ID for the live stream that you want to remove.
err := client.LiveStreams.Delete(liveStreamId)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Delete``: %v\
", err)
}
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#delete
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique identifier of the live stream whose thumbnail you want to delete.
const liveStream = await client.liveStreams.deleteThumbnail(liveStreamId);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#delete
import apivideo
from apivideo.api import live_streams_api
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = live_streams_api.LiveStreamsApi(api_client)
live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream that you want to remove.
# example passing only required values which don't have defaults set
try:
# Delete a live stream
api_instance.delete(live_stream_id)
except apivideo.ApiException as e:
print("Exception when calling LiveStreamsApi->delete: %s\n" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#delete
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
LiveStreamsApi apiInstance = client.liveStreams();
String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream that you want to remove.
try {
apiInstance.delete(liveStreamId);
} catch (ApiException e) {
System.err.println("Exception when calling LiveStreamsApi#delete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#delete
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class deleteExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique ID for the live stream that you want to remove.
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Delete a live stream
apiLiveStreamsInstance.delete(liveStreamId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.delete: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#delete
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique identifier of the live stream whose thumbnail you want to delete.
$liveStream = $client->liveStreams()->deleteThumbnail($liveStreamId);
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#delete
No Content
Empty response
Too Many Requests
{
"type": "https://docs.api.video/reference/too-many-requests",
"title": "Too many requests.",
"status": 429
}
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
Empty response
/live-streams/{liveStreamId}
Updates the livestream object.
name
string
The name you want to use for your live stream.
public
boolean
Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here.
playerId
string
The unique ID for the player associated with a live stream that you want to update.
restreams
array[object (Restreams request object)]
Use this parameter to add, edit, or remove RTMPS
or RTMP
services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed.
Restreams request object
object (Restreams request object)
Adding restream destinations is optional. However, if you set a restream destination, you must provide all attributes for each destination.
name
string
required
Use this parameter to define a name for the restream destination.
serverUrl
string
required
Use this parameter to set the RTMPS
or RTMP
server URL of the restream destination.
streamKey
string
required
Use this parameter to provide the unique key of the live stream that you want to restream.
apiKey
liveStreamId
string
required
The unique ID for the live stream that you want to update information for such as player details.
Too Many Requests
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Bad Request
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
problems
array[object (BadRequest)]
Returns any additional problems in the request in an array of objects.
BadRequest
object (BadRequest)
type
string
A link to the error documentation.
title
string
A description of the error that occurred.
name
string
The name of the parameter that caused the error.
status
int
The HTTP status code.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
Success
liveStreamId
string
required
The unique identifier for the live stream. Live stream IDs begin with "li."
name
string
The name of your live stream.
streamKey
string
The unique, private stream key that you use to begin streaming.
public
boolean
Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view. Learn more about the Private Video feature here.
assets
object (assets)
hls
string
The http live streaming (HLS) link for your live video stream.
iframe
string
The embed code for the iframe containing your live video stream.
player
string
A link to the video player that is playing your live stream.
thumbnail
string
A link to the thumbnail for your video.
playerId
string
The unique identifier for the player.
broadcasting
boolean
Whether or not you are broadcasting the live video you recorded for others to see. True means you are broadcasting to viewers, false means you are not.
restreams
array[object (Restreams response object)]
required
Returns the list of restream destinations.
Restreams response object
object (Restreams response object)
name
string
Returns the name of a restream destination.
serverUrl
string
Returns the server URL of a restream destination.
streamKey
string
Returns the unique key of the live stream that is set up for restreaming.
createdAt
string
When the player was created, presented in ISO-8601 format.
updatedAt
string
When the player was last updated, presented in ISO-8601 format.
X-RateLimit-Limit
int
The request limit per minute.
X-RateLimit-Remaining
int
The number of available requests left for the current time window.
X-RateLimit-Retry-After
int
The number of seconds left until the current rate limit window resets.
{
"name": "My Live Stream Video",
"public": true,
"playerId": "pl45KFKdlddgk654dspkze",
"restreams": [
{
"name": "My restream server",
"serverUrl": "rtmp://my.broadcast.example.com/app",
"streamKey": "dw-dew8-q6w9-k67w-1ws8"
}
]
}
// First install the go client with "go get github.com/apivideo/api.video-go-client"
// Documentation: https://github.com/apivideo/api.video-go-client/blob/main/docs/LiveStreamsApi.md#update
package main
import (
"context"
"fmt"
"os"
apivideosdk "github.com/apivideo/api.video-go-client"
)
func main() {
client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build()
// if you rather like to use the sandbox environment:
// client := apivideosdk.SandboxClientBuilder("YOUR_SANDBOX_API_KEY").Build()
liveStreamId := "li400mYKSgQ6xs7taUeSaEKr" // string | The unique ID for the live stream that you want to update information for such as player details.
liveStreamUpdatePayload := apivideosdk.LiveStreamUpdatePayload{}
liveStreamUpdatePayload.SetName("My Live Stream Video") // The name you want to use for your live stream.
liveStreamUpdatePayload.SetPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it.
liveStreamUpdatePayload.SetPlayerId("pl4f4ferf5erfr5zed4fsdd") // The unique ID for the player associated with a live stream that you want to update.
liveStreamUpdatePayload.SetRestreams([]RestreamsRequestObject{{Name: "My RTMP server", ServerUrl: "rtmp://my.broadcast.example.com/app", StreamKey: "dw-dew8-q6w9-k67w-1ws8"}}) // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed.
res, err := client.LiveStreams.Update(liveStreamId, liveStreamUpdatePayload)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LiveStreams.Update``: %v\
", err)
}
// response from `Update`: LiveStream
fmt.Fprintf(os.Stdout, "Response from `LiveStreams.Update`: %v\
", res)
}
// First install the "@api.video/nodejs-client" npm package
// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/LiveStreamsApi.md#update
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });
const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream that you want to update information for such as player details.
const liveStreamUpdatePayload = {
name: "My Live Stream Video", // The name you want to use for your live stream.
_public: true, // Whether your video can be viewed by everyone, or requires authentication to see it.
playerId: "pl45KFKdlddgk654dspkze", // The unique ID for the player associated with a live stream that you want to update.
restreams: [ // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations.
{
streamKey: "dw-dew8-q6w9-k67w-1ws8",
serverUrl: "rtmp://my.broadcast.example.com/app",
name: "My RTMP server",
},
],
};
const liveStream = await client.liveStreams.update(liveStreamId, liveStreamUpdatePayload);
# First install the api client with "pip install api.video"
# Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/LiveStreamsApi.md#update
import apivideo
from apivideo.api import live_streams_api
from apivideo.model.bad_request import BadRequest
from apivideo.model.live_stream_update_payload import LiveStreamUpdatePayload
from apivideo.model.live_stream import LiveStream
from pprint import pprint
# Enter a context with an instance of the API client
with apivideo.AuthenticatedApiClient(__API_KEY__) as api_client:
# Create an instance of the API class
api_instance = live_streams_api.LiveStreamsApi(api_client)
live_stream_id = "li400mYKSgQ6xs7taUeSaEKr" # str | The unique ID for the live stream that you want to update information for such as player details.
live_stream_update_payload = LiveStreamUpdatePayload(
name="My Live Stream Video",
public=True,
player_id="pl45KFKdlddgk654dspkze",
restreams=[
RestreamsRequestObject(
name="My RTMP server",
server_url="rtmp://my.broadcast.example.com",
stream_key="dw-dew8-q6w9-k67w-1ws8",
),
],
) # LiveStreamUpdatePayload |
# example passing only required values which don't have defaults set
try:
# Update a live stream
api_response = api_instance.update(live_stream_id, live_stream_update_payload)
pprint(api_response)
except apivideo.ApiException as e:
print("Exception when calling LiveStreamsApi->update: %s\
" % e)
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/LiveStreamsApi.md#update
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.LiveStreamsApi;
import java.util.*;
public class Example {
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY");
// if you rather like to use the sandbox environment:
// ApiVideoClient client = new ApiVideoClient("YOUR_SANDBOX_API_KEY", ApiVideoClient.Environment.SANDBOX);
LiveStreamsApi apiInstance = client.liveStreams();
String liveStreamId = "li400mYKSgQ6xs7taUeSaEKr"; // The unique ID for the live stream that you want to update information for such as player details.
LiveStreamUpdatePayload liveStreamUpdatePayload = new LiveStreamUpdatePayload(); //
liveStreamUpdatePayload.setName("My Live Stream Video"); // The name you want to use for your live stream.
liveStreamUpdatePayload.setPublic(); // Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view.
liveStreamUpdatePayload.setPlayerId("pl45KFKdlddgk654dspkze"); // The unique ID for the player associated with a live stream that you want to update.
liveStreamUpdatePayload.setRestreams(Collections.singletonList(new RestreamsRequestObject() // Use this parameter to add, edit, or remove RTMP services where you want to restream a live stream. The list can only contain up to 5 destinations. This operation updates all restream destinations in the same request. If you do not want to modify an existing restream destination, you need to include it in your request, otherwise it is removed.
.name("My RTMP server")
.serverUrl("rtmp://my.broadcast.example.com/app")
.streamKey("dw-dew8-q6w9-k67w-1ws8")));
try {
LiveStream result = apiInstance.update(liveStreamId, liveStreamUpdatePayload);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LiveStreamsApi#update");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
// First add the "ApiVideo" NuGet package to your project
// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/LiveStreamsApi.md#update
using System.Diagnostics;
using ApiVideo.Client;
namespace Example
{
public class updateExample
{
public static void Main()
{
var basePath = ApiVideoClient.Client.Environment.SANDBOX;
var apiKey = "YOUR_API_KEY";
var apiInstance = new ApiVideoClient(apiKey,basePath);
var liveStreamId = li400mYKSgQ6xs7taUeSaEKr; // string | The unique ID for the live stream that you want to update information for such as player details.
var liveStreamUpdatePayload = new LiveStreamUpdatePayload(); // LiveStreamUpdatePayload |
var apiLiveStreamsInstance = apiInstance.LiveStreams();
try
{
// Update a live stream
LiveStream result = apiLiveStreamsInstance.update(liveStreamId, liveStreamUpdatePayload);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling LiveStreamsApi.update: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
<?php
// First install the api client: "composer require api-video/php-api-client"
// Documentation: https://github.com/apivideo/api.video-php-client/blob/main/docs/Api/LiveStreamsApi.md#update
require __DIR__ . '/vendor/autoload.php';
$client = new \ApiVideo\Client\Client(
'https://ws.api.video',
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\Psr18Client()
);
$liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream that you want to update information for such as player details.
$liveStreamUpdatePayload = (new \ApiVideo\Client\Model\LiveStreamUpdatePayload())
->setName("My Live Stream Video") // The name you want to use for your live stream.)
->setPublic(true) // Whether your video can be viewed by everyone, or requires authentication to see it. )
->setPlayerId("pl45KFKdlddgk654dspkze") // The unique ID for the player associated with a live stream that you want to update.)
->setRestreams(array(
new RestreamsRequestObject(['name' => 'My RTMP server', 'serverUrl' => 'rtmp://my.broadcast.example.com/app', 'streamKey' => 'dw-dew8-q6w9-k67w-1ws8'])));
$liveStream = $client->liveStreams()->update($liveStreamId, $liveStreamUpdatePayload);
// First install the api client: https://github.com/apivideo/api.video-swift-client#getting-started
// Documentation: https://github.com/apivideo/api.video-swift-client/blob/main/docs/LiveStreamsAPI.md#update
ApiVideoClient.apiKey = "YOUR_API_KEY"
let liveStreamId = "li400mYKSgQ6xs7taUeSaEKr" // String | The unique ID for the live stream that you want to update information for such as player details.
let liveStreamUpdatePayload = LiveStreamUpdatePayload(
name: "My Live Stream Video",
_public: true,
playerId: "pl4f4ferf5erfr5zed4fsdd",
restreams: [RestreamsRequestObject(
name: "My RTMP server",
serverUrl: "rtmp://my.broadcast.example.com/app",
streamKey: "dw-dew8-q6w9-k67w-1ws8"
)]
)
LiveStreamsAPI.update(liveStreamId: liveStreamId, liveStreamUpdatePayload: liveStreamUpdatePayload) { liveStream, error in
if let liveStream = liveStream {
// Do something with the livestream
}
if let error = error {
// Manage update error here
}
}
Success
{
"liveStreamId": "li4pqNqGUkhKfWcBGpZVLRY5",
"createdAt": "2020-07-29T10:45:35.000Z",
"updatedAt": "2020-07-29T10:45:35.000Z",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135",
"restreams": [
{
"name": "YouTube",
"serverUrl": "rtmp://youtube.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
},
{
"name": "Twitch",
"serverUrl": "rtmp://twitch.broadcast.example.com",
"streamKey": "cc1b4df0-d1c5-4064-a8f9-9f0368385135"
}
],
"name": "Live From New York",
"public": true,
"broadcasting": false,
"assets": {
"iframe": "<iframe src=\"https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"no\" allowfullscreen=\"\"></iframe>",
"player": "https://embed.api.video/live/li4pqNqGUkhKfWcBGpZVLRY5",
"hls": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5.m3u8",
"thumbnail": "https://live.api.video/li4pqNqGUkhKfWcBGpZVLRY5/thumbnail.jpg"
}
}
Bad Request
{
"type": "https://docs.api.video/reference/invalid-attribute",
"title": "An attribute is invalid."