Skip to content

Files

Latest commit

 Cannot retrieve latest commit at this time.

History

History
570 lines (438 loc) · 25.4 KB

LiveStreamsApi.md

File metadata and controls

570 lines (438 loc) · 25.4 KB

ApiVideo.Api.LiveStreamsApi

All URIs are relative to https://ws.api.video

Method HTTP request Description
create POST /live-streams Create live stream
get GET /live-streams/{liveStreamId} Retrieve live stream
update PATCH /live-streams/{liveStreamId} Update a live stream
delete DELETE /live-streams/{liveStreamId} Delete a live stream
list GET /live-streams List all live streams
uploadThumbnail POST /live-streams/{liveStreamId}/thumbnail Upload a thumbnail
deleteThumbnail DELETE /live-streams/{liveStreamId}/thumbnail Delete a thumbnail
complete PUT /live-streams/{liveStreamId}/complete Complete a live stream

create

LiveStream create (LiveStreamCreationPayload liveStreamCreationPayload)

Create live stream

Creates a livestream object.

Example

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class createExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamCreationPayload = new LiveStreamCreationPayload(); // LiveStreamCreationPayload | 
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Create live stream
                LiveStream result = apiLiveStreamsInstance.create(liveStreamCreationPayload);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.create: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamCreationPayload LiveStreamCreationPayload

Return type

LiveStream

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
400 Bad Request * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get

LiveStream get (string liveStreamId)

Retrieve live stream

Get a livestream by id.

Example

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
            {
                // Retrieve 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);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamId string The unique ID for the live stream you want to watch.

Return type

LiveStream

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update

LiveStream update (string liveStreamId, LiveStreamUpdatePayload liveStreamUpdatePayload)

Update a live stream

Updates the livestream object.

Example

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);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamId string The unique ID for the live stream that you want to update information for such as player details.
liveStreamUpdatePayload LiveStreamUpdatePayload

Return type

LiveStream

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
400 Bad Request * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete

void delete (string liveStreamId)

Delete a live stream

If you do not need a live stream any longer, you can send a request to delete it. All you need is the liveStreamId.

Example

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);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamId string The unique ID for the live stream that you want to remove.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 No Content * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list

LiveStreamListResponse list (string streamKey = null, string name = null, string sortBy = null, string sortOrder = null, int? currentPage = null, int? pageSize = null)

List all live streams

Get the list of livestreams on the workspace.

Example

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class listExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var streamKey = dw-dew8-q6w9-k67w-1ws8;  // string | The unique stream key that allows you to stream videos. (optional) 
            var name = My Video;  // string | You can filter live streams by their name or a part of their name. (optional) 
            var sortBy = createdAt;  // 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 ATOM UTC time format.  (optional) 
            var 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. (optional) 
            var currentPage = 2;  // int? | Choose the number of search results to return per page. Minimum value: 1 (optional)  (default to 1)
            var pageSize = 30;  // int? | Results per page. Allowed values 1-100, default is 25. (optional)  (default to 25)
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // List all live streams
                LiveStreamListResponse result = apiLiveStreamsInstance.list(streamKey, name, sortBy, sortOrder, currentPage, pageSize);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.list: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
streamKey string The unique stream key that allows you to stream videos. [optional]
name string You can filter live streams by their name or a part of their name. [optional]
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 ATOM UTC time format. [optional]
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. [optional]
currentPage int? Choose the number of search results to return per page. Minimum value: 1 [optional] [default to 1]
pageSize int? Results per page. Allowed values 1-100, default is 25. [optional] [default to 25]

Return type

LiveStreamListResponse

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

uploadThumbnail

LiveStream uploadThumbnail (string liveStreamId, System.IO.Stream file)

Upload a thumbnail

Upload the thumbnail for the livestream.

Example

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class uploadThumbnailExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = vi4k0jvEUuaTdRAEjQ4Jfrgz;  // string | The unique ID for the live stream you want to upload.
            var file = BINARY_DATA_HERE;  // System.IO.Stream | The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Upload a thumbnail
                LiveStream result = apiLiveStreamsInstance.uploadThumbnail(liveStreamId, file);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.uploadThumbnail: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamId string The unique ID for the live stream you want to upload.
file System.IO.Stream****System.IO.Stream The image to be added as a thumbnail. The mime type should be image/jpeg, image/png or image/webp. The max allowed size is 8 MiB.

Return type

LiveStream

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
400 Bad Request * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteThumbnail

LiveStream deleteThumbnail (string liveStreamId)

Delete a thumbnail

Send the unique identifier for a live stream to delete its thumbnail.

Example

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class deleteThumbnailExample
    {
        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 identifier of the live stream whose thumbnail you want to delete.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Delete a thumbnail
                LiveStream result = apiLiveStreamsInstance.deleteThumbnail(liveStreamId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.deleteThumbnail: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamId string The unique identifier of the live stream whose thumbnail you want to delete.

Return type

LiveStream

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

complete

void complete (string liveStreamId)

Complete a live stream

Request the completion of a live stream that is currently running. This operation is asynchronous and the live stream will stop after a few seconds. The API adds the EXT-X-ENDLIST tag to the live stream's HLS manifest. This stops the live stream on the player and also stops the recording of the live stream. The API keeps the incoming connection from the streamer open for at most 1 minute, which can be used to terminate the stream.

Example

using System.Diagnostics;
using ApiVideo.Client;

namespace Example
{
    public class completeExample
    {
        public static void Main()
        {
            var basePath = ApiVideoClient.Client.Environment.SANDBOX;
            var apiKey = "YOUR_API_KEY";

            var apiInstance = new ApiVideoClient(apiKey,basePath);

            var liveStreamId = vi4k0jvEUuaTdRAEjQ4Jfrgz;  // string | The unique ID for the live stream you want to complete.
            var apiLiveStreamsInstance = apiInstance.LiveStreams();
            try
            {
                // Complete a live stream
                apiLiveStreamsInstance.complete(liveStreamId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling LiveStreamsApi.complete: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
liveStreamId string The unique ID for the live stream you want to complete.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
202 Accepted * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
404 Not Found * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.
429 Too Many Requests * X-RateLimit-Limit - The request limit per minute.
* X-RateLimit-Remaining - The number of available requests left for the current time window.
* X-RateLimit-Retry-After - The number of seconds left until the current rate limit window resets.

[Back to top] [Back to API list] [Back to Model list] [Back to README]