Skip to content

Commit

Permalink
Merge pull request #63 from apivideo/feat/live-restreaming
Browse files Browse the repository at this point in the history
Feat/live restreaming
  • Loading branch information
bot-api-video authored Jun 28, 2023
2 parents ba6b3a0 + 5a44763 commit 914c2e6
Show file tree
Hide file tree
Showing 14 changed files with 1,046 additions and 86 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Changelog
All changes to this project will be documented in this file.

## [1.3.0] - 2023-06-19
## [1.3.0] - 2023-06-28
- Introducing live streams restream feature
- Introducing new analytics endpoints

## [1.2.6] - 2022-09-13
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ Method | HTTP request | Description
- [RawStatisticsListPlayerSessionEventsResponse](docs/RawStatisticsListPlayerSessionEventsResponse.md)
- [RawStatisticsListSessionsResponse](docs/RawStatisticsListSessionsResponse.md)
- [RefreshTokenPayload](docs/RefreshTokenPayload.md)
- [RestreamsRequestObject](docs/RestreamsRequestObject.md)
- [RestreamsResponseObject](docs/RestreamsResponseObject.md)
- [TokenCreationPayload](docs/TokenCreationPayload.md)
- [TokenListResponse](docs/TokenListResponse.md)
- [UploadToken](docs/UploadToken.md)
Expand Down
436 changes: 355 additions & 81 deletions api/openapi.yaml

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion docs/LiveStream.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ Name | Type | Description | Notes
**Assets** | Pointer to [**LiveStreamAssets**](LiveStreamAssets.md) | | [optional]
**PlayerId** | Pointer to **string** | The unique identifier for the player. | [optional]
**Broadcasting** | Pointer to **bool** | 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. | [optional]
**Restreams** | [**[]RestreamsResponseObject**](RestreamsResponseObject.md) | Returns the list of RTMP restream destinations. |
**CreatedAt** | Pointer to **string** | When the player was created, presented in ISO-8601 format. | [optional]
**UpdatedAt** | Pointer to **string** | When the player was last updated, presented in ISO-8601 format. | [optional]

## Methods

### NewLiveStream

`func NewLiveStream(liveStreamId string, ) *LiveStream`
`func NewLiveStream(liveStreamId string, restreams []RestreamsResponseObject, ) *LiveStream`

NewLiveStream instantiates a new LiveStream object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -229,6 +230,26 @@ SetBroadcasting sets Broadcasting field to given value.

HasBroadcasting returns a boolean if a field has been set.

### GetRestreams

`func (o *LiveStream) GetRestreams() []RestreamsResponseObject`

GetRestreams returns the Restreams field if non-nil, zero value otherwise.

### GetRestreamsOk

`func (o *LiveStream) GetRestreamsOk() (*[]RestreamsResponseObject, bool)`

GetRestreamsOk returns a tuple with the Restreams field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetRestreams

`func (o *LiveStream) SetRestreams(v []RestreamsResponseObject)`

SetRestreams sets Restreams field to given value.


### GetCreatedAt

`func (o *LiveStream) GetCreatedAt() string`
Expand Down
26 changes: 26 additions & 0 deletions docs/LiveStreamCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**Record** | Pointer to **bool** | Whether you are recording or not. True for record, false for not record. | [optional] [default to false]
**Public** | Pointer to **bool** | 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](https://docs.api.video/docs/private-videos). | [optional]
**PlayerId** | Pointer to **string** | The unique identifier for the player. | [optional]
**Restreams** | Pointer to [**[]RestreamsRequestObject**](RestreamsRequestObject.md) | 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. | [optional]

## Methods

Expand Down Expand Up @@ -123,6 +124,31 @@ SetPlayerId sets PlayerId field to given value.

HasPlayerId returns a boolean if a field has been set.

### GetRestreams

`func (o *LiveStreamCreationPayload) GetRestreams() []RestreamsRequestObject`

GetRestreams returns the Restreams field if non-nil, zero value otherwise.

### GetRestreamsOk

`func (o *LiveStreamCreationPayload) GetRestreamsOk() (*[]RestreamsRequestObject, bool)`

GetRestreamsOk returns a tuple with the Restreams field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetRestreams

`func (o *LiveStreamCreationPayload) SetRestreams(v []RestreamsRequestObject)`

SetRestreams sets Restreams field to given value.

### HasRestreams

`func (o *LiveStreamCreationPayload) HasRestreams() bool`

HasRestreams returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
26 changes: 26 additions & 0 deletions docs/LiveStreamUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**Public** | Pointer to **bool** | 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](https://docs.api.video/docs/private-videos). | [optional]
**Record** | Pointer to **bool** | Use this to indicate whether you want the recording on or off. On is true, off is false. | [optional]
**PlayerId** | Pointer to **string** | The unique ID for the player associated with a live stream that you want to update. | [optional]
**Restreams** | Pointer to [**[]RestreamsRequestObject**](RestreamsRequestObject.md) | 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. | [optional]

## Methods

Expand Down Expand Up @@ -128,6 +129,31 @@ SetPlayerId sets PlayerId field to given value.

HasPlayerId returns a boolean if a field has been set.

### GetRestreams

`func (o *LiveStreamUpdatePayload) GetRestreams() []RestreamsRequestObject`

GetRestreams returns the Restreams field if non-nil, zero value otherwise.

### GetRestreamsOk

`func (o *LiveStreamUpdatePayload) GetRestreamsOk() (*[]RestreamsRequestObject, bool)`

GetRestreamsOk returns a tuple with the Restreams field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetRestreams

`func (o *LiveStreamUpdatePayload) SetRestreams(v []RestreamsRequestObject)`

SetRestreams sets Restreams field to given value.

### HasRestreams

`func (o *LiveStreamUpdatePayload) HasRestreams() bool`

HasRestreams returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
9 changes: 7 additions & 2 deletions docs/LiveStreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ liveStreamCreationPayload.SetName("My Live Stream Video") // Add a name for your
liveStreamCreationPayload.SetRecord(false) // Whether you are recording or not. True for record, false for not record.
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)

Expand Down Expand Up @@ -157,9 +158,13 @@ func main() {
// 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, or whether you want the recording on or off.
liveStreamUpdatePayload := *apivideosdk.NewLiveStreamUpdatePayload() // LiveStreamUpdatePayload |
liveStreamUpdatePayload := apivideosdk.LiveStreamUpdatePayload{}
liveStreamUpdatePayload.SetName("My Live Stream Video") // The name you want to use for your live stream.
liveStreamUpdatePayload.SetRecord(false) // Use this to indicate whether you want the recording on or off. On is true, off is false.
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 {
Expand Down
93 changes: 93 additions & 0 deletions docs/RestreamsRequestObject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# RestreamsRequestObject

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | Use this parameter to define a name for the restream destination. |
**ServerUrl** | **string** | Use this parameter to set the RTMP URL of the restream destination. |
**StreamKey** | **string** | Use this parameter to provide the unique key of the live stream that you want to restream. |

## Methods

### NewRestreamsRequestObject

`func NewRestreamsRequestObject(name string, serverUrl string, streamKey string, ) *RestreamsRequestObject`

NewRestreamsRequestObject instantiates a new RestreamsRequestObject object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewRestreamsRequestObjectWithDefaults

`func NewRestreamsRequestObjectWithDefaults() *RestreamsRequestObject`

NewRestreamsRequestObjectWithDefaults instantiates a new RestreamsRequestObject object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetName

`func (o *RestreamsRequestObject) GetName() string`

GetName returns the Name field if non-nil, zero value otherwise.

### GetNameOk

`func (o *RestreamsRequestObject) GetNameOk() (*string, bool)`

GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetName

`func (o *RestreamsRequestObject) SetName(v string)`

SetName sets Name field to given value.


### GetServerUrl

`func (o *RestreamsRequestObject) GetServerUrl() string`

GetServerUrl returns the ServerUrl field if non-nil, zero value otherwise.

### GetServerUrlOk

`func (o *RestreamsRequestObject) GetServerUrlOk() (*string, bool)`

GetServerUrlOk returns a tuple with the ServerUrl field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetServerUrl

`func (o *RestreamsRequestObject) SetServerUrl(v string)`

SetServerUrl sets ServerUrl field to given value.


### GetStreamKey

`func (o *RestreamsRequestObject) GetStreamKey() string`

GetStreamKey returns the StreamKey field if non-nil, zero value otherwise.

### GetStreamKeyOk

`func (o *RestreamsRequestObject) GetStreamKeyOk() (*string, bool)`

GetStreamKeyOk returns a tuple with the StreamKey field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetStreamKey

`func (o *RestreamsRequestObject) SetStreamKey(v string)`

SetStreamKey sets StreamKey field to given value.



[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


108 changes: 108 additions & 0 deletions docs/RestreamsResponseObject.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# RestreamsResponseObject

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | Pointer to **string** | Returns the name of a restream destination. | [optional]
**ServerUrl** | Pointer to **string** | Returns the RTMP URL of a restream destination. | [optional]
**StreamKey** | Pointer to **string** | Returns the unique key of the live stream that is set up for restreaming. | [optional]

## Methods

### NewRestreamsResponseObject

`func NewRestreamsResponseObject() *RestreamsResponseObject`

NewRestreamsResponseObject instantiates a new RestreamsResponseObject object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewRestreamsResponseObjectWithDefaults

`func NewRestreamsResponseObjectWithDefaults() *RestreamsResponseObject`

NewRestreamsResponseObjectWithDefaults instantiates a new RestreamsResponseObject object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetName

`func (o *RestreamsResponseObject) GetName() string`

GetName returns the Name field if non-nil, zero value otherwise.

### GetNameOk

`func (o *RestreamsResponseObject) GetNameOk() (*string, bool)`

GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetName

`func (o *RestreamsResponseObject) SetName(v string)`

SetName sets Name field to given value.

### HasName

`func (o *RestreamsResponseObject) HasName() bool`

HasName returns a boolean if a field has been set.

### GetServerUrl

`func (o *RestreamsResponseObject) GetServerUrl() string`

GetServerUrl returns the ServerUrl field if non-nil, zero value otherwise.

### GetServerUrlOk

`func (o *RestreamsResponseObject) GetServerUrlOk() (*string, bool)`

GetServerUrlOk returns a tuple with the ServerUrl field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetServerUrl

`func (o *RestreamsResponseObject) SetServerUrl(v string)`

SetServerUrl sets ServerUrl field to given value.

### HasServerUrl

`func (o *RestreamsResponseObject) HasServerUrl() bool`

HasServerUrl returns a boolean if a field has been set.

### GetStreamKey

`func (o *RestreamsResponseObject) GetStreamKey() string`

GetStreamKey returns the StreamKey field if non-nil, zero value otherwise.

### GetStreamKeyOk

`func (o *RestreamsResponseObject) GetStreamKeyOk() (*string, bool)`

GetStreamKeyOk returns a tuple with the StreamKey field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetStreamKey

`func (o *RestreamsResponseObject) SetStreamKey(v string)`

SetStreamKey sets StreamKey field to given value.

### HasStreamKey

`func (o *RestreamsResponseObject) HasStreamKey() bool`

HasStreamKey returns a boolean if a field has been set.


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit 914c2e6

Please sign in to comment.