From e406a44b36477a42ade89f243b05eefddc1e08de Mon Sep 17 00:00:00 2001 From: szekelyzol Date: Fri, 20 Oct 2023 12:32:34 +0200 Subject: [PATCH] SEO additions to VOD pages --- templates/documentation/vod/README.md | 3 +- .../vod/add-a-permanent-watermark.md | 7 +- .../vod/add-a-thumbnail-to-your-video.md | 8 +- templates/documentation/vod/add-captions.md | 3 +- .../vod/amazon-cold-storage-backup.md | 4 +- .../vod/azure-cold-storage-backup.md | 4 +- .../vod/backup-and-cold-storage.md | 3 +- templates/documentation/vod/clip-a-video.md | 3 +- .../vod/create-and-manage-webhooks.md | 567 ------------------ .../vod/creating-and-managing-chapters.md | 3 +- .../vod/delegated-upload-tokens.md | 3 +- templates/documentation/vod/delete-a-video.md | 8 +- .../documentation/vod/demo-loom-clone.md | 4 +- .../documentation/vod/demo-youtube-clone.md | 4 +- .../documentation/vod/demos-airbnb-clone.md | 4 +- .../vod/demos-prog-upload-uploader.md | 4 +- .../vod/demos-template-overview.md | 8 +- .../documentation/vod/demos-tiktok-clone.md | 4 +- .../documentation/vod/demos-udemy-clone.md | 4 +- .../documentation/vod/demos-video-uploader.md | 4 +- .../documentation/vod/downloading-videos.md | 12 - .../documentation/vod/encoding-transcoding.md | 8 +- .../vod/get-started-in-5-minutes.md | 8 +- .../vod/google-cold-storage-backup.md | 6 +- templates/documentation/vod/list-videos-2.md | 7 +- .../documentation/vod/progressive-upload.md | 8 +- .../documentation/vod/show-video-details.md | 7 +- .../vod/show-video-upload-status.md | 8 +- .../documentation/vod/update-video-details.md | 8 +- .../vod/upload-a-video-regular-upload.md | 8 +- .../documentation/vod/upload-from-source.md | 4 +- .../vod/upload-your-first-video.md | 532 ---------------- .../documentation/vod/video-best-practices.md | 9 +- templates/documentation/vod/video-download.md | 3 +- .../vod/video-management-basics.md | 6 +- templates/documentation/vod/video-object.md | 8 +- .../vod/video-playback-features.md | 7 +- templates/documentation/vod/video-tagging.md | 9 +- 38 files changed, 111 insertions(+), 1199 deletions(-) delete mode 100644 templates/documentation/vod/create-and-manage-webhooks.md delete mode 100644 templates/documentation/vod/downloading-videos.md delete mode 100644 templates/documentation/vod/upload-your-first-video.md diff --git a/templates/documentation/vod/README.md b/templates/documentation/vod/README.md index e21fc5a7..4f45b87c 100644 --- a/templates/documentation/vod/README.md +++ b/templates/documentation/vod/README.md @@ -1,6 +1,5 @@ --- -title: "VOD overview" -slug: "vod-overview" +title: VOD overview hide_side_table_of_contents: true meta: description: This page serves as a foundational guide to integrating api.video's solutions for video on demand (VOD). diff --git a/templates/documentation/vod/add-a-permanent-watermark.md b/templates/documentation/vod/add-a-permanent-watermark.md index 750a5ad8..fbb4ae01 100644 --- a/templates/documentation/vod/add-a-permanent-watermark.md +++ b/templates/documentation/vod/add-a-permanent-watermark.md @@ -1,9 +1,10 @@ --- -title: "Watermarks" +title: Watermarks +meta: + description: Learn how to apply permanent watermarks programmatically to videos uploaded to api.video. --- -Add A Permanent Watermark -========================= +# Add A Permanent Watermark api.video gives you the ability to add permanent watermarks to your videos. diff --git a/templates/documentation/vod/add-a-thumbnail-to-your-video.md b/templates/documentation/vod/add-a-thumbnail-to-your-video.md index 367f7ed8..61b0026f 100644 --- a/templates/documentation/vod/add-a-thumbnail-to-your-video.md +++ b/templates/documentation/vod/add-a-thumbnail-to-your-video.md @@ -1,8 +1,10 @@ --- -title: "Add a thumbnail to your video" +title: Add a thumbnail to your video +meta: + description: Learn how to add thumbnails programmatically or via the Dashboard to videos uploaded to api.video. --- -Add A Thumbnail To Your Video -============================= + +# Add A Thumbnail To Your Video For videos or recorded live streams, api.video offers you two ways to add a thumbnail: diff --git a/templates/documentation/vod/add-captions.md b/templates/documentation/vod/add-captions.md index 2f3b2a6f..c85a7d1f 100644 --- a/templates/documentation/vod/add-captions.md +++ b/templates/documentation/vod/add-captions.md @@ -1,6 +1,5 @@ --- -title: "Adding captions" -slug: "add-captions" +title: Adding captions meta: description: This page gets users started on how to add captions to their videos using the api.video Captions endpoint. --- diff --git a/templates/documentation/vod/amazon-cold-storage-backup.md b/templates/documentation/vod/amazon-cold-storage-backup.md index 3a8945a2..7ab82221 100644 --- a/templates/documentation/vod/amazon-cold-storage-backup.md +++ b/templates/documentation/vod/amazon-cold-storage-backup.md @@ -1,9 +1,9 @@ --- -title: "Backup your videos to Amazon S3" -slug: "amazon-cold-storage-backup" +title: Backup your videos to Amazon S3 meta: description: Backup videos uploaded to api.video to Amazon Storage account with a simple script. --- + # Video backup to Amazon S3 At [api.video](https://api.video/) we understand that sometimes, you want to make sure that your videos are safe and secure. Although api.video has a backup and disaster recovery plan, it’s up to you to decide if you want an extra backup resource or if you would like to use api.video just to transcode your videos but eventually store them on a different resource. diff --git a/templates/documentation/vod/azure-cold-storage-backup.md b/templates/documentation/vod/azure-cold-storage-backup.md index d27fcf99..db3994c7 100644 --- a/templates/documentation/vod/azure-cold-storage-backup.md +++ b/templates/documentation/vod/azure-cold-storage-backup.md @@ -1,9 +1,9 @@ --- -title: "Backup your videos to Azure" -slug: "azure-cold-storage-backup" +title: Backup your videos to Azure meta: description: Backup videos uploaded to api.video to Azure Storage account with a simple script. --- + # Video backup to Azure Storage account At [api.video](https://api.video/) we understand that sometimes, you want to make sure that your videos are safe and secure. Although api.video has a backup and disaster recovery plan, it’s up to you to decide if you want an extra backup resource or if you would like to use api.video just to transcode your videos but eventually store them on a different resource. diff --git a/templates/documentation/vod/backup-and-cold-storage.md b/templates/documentation/vod/backup-and-cold-storage.md index 387f939d..4c77e148 100644 --- a/templates/documentation/vod/backup-and-cold-storage.md +++ b/templates/documentation/vod/backup-and-cold-storage.md @@ -1,6 +1,5 @@ --- -title: "api.video backup and cold storage" -slug: "backup-and-cold-storage" +title: api.video backup and cold storage meta: description: Backup your uploaded videos to your preferred provider. --- diff --git a/templates/documentation/vod/clip-a-video.md b/templates/documentation/vod/clip-a-video.md index 0b767a17..c3d57fad 100644 --- a/templates/documentation/vod/clip-a-video.md +++ b/templates/documentation/vod/clip-a-video.md @@ -1,6 +1,5 @@ --- -title: "clip and trim videos with api.video" -slug: "clip-a-video" +title: clip and trim videos with api.video meta: description: Clip and trim a video while uploading to api.video --- diff --git a/templates/documentation/vod/create-and-manage-webhooks.md b/templates/documentation/vod/create-and-manage-webhooks.md deleted file mode 100644 index 13dedabe..00000000 --- a/templates/documentation/vod/create-and-manage-webhooks.md +++ /dev/null @@ -1,567 +0,0 @@ ---- -title: "Webhooks" -slug: "create-and-manage-webhooks" -hidden: false -metadata: - description: "api.video provides you the possibility to get a `POST` request to your server that contains a JSON payload with event data. Webhooks can push notifications directly to your server, saving you the need to poll api.video for changes. This guide goes over how to create and manage your webhooks." -createdAt: "2022-01-22T07:01:19.493Z" -updatedAt: "2023-05-31T08:01:24.966Z" ---- - -# Create And Manage Webhooks - -api.video provides you the possibility to get a `POST` request to your server that contains a JSON payload with event data. Webhooks can push notifications directly to your server, saving you the need to poll api.video for changes. - -## Webhook events - -| Event | Description | -| :--------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `live-stream.broadcast.started` | Triggers to indicate that a live stream broadcast has started. | -| `live-stream.broadcast.ended` | Triggers to indicate that a live stream broadcast has ended. | -| `video.source.recorded` | Triggers to indicate that a live stream has been completed and the recording of the live stream (if you set it to record) is ready to be transcoded. NOTE: This means the video has been enqueued for transcoding. | -| `video.encoding.quality.completed` | Triggers when you upload a video, every time api.video finishes encoding a video in a set quality (up to the same level of quality that you uploaded), you get an announcement about it. | - -
- -Here’s how the `video.encoding` webhook’s flow looks like: - -![](/_assets/webhooks-schema.png) - -## Event properties - -api.video offers the following webhook events that you can set up webhooks for: - -### `live-stream.broadcast.started` - -Triggers to indicate that a live stream broadcast has started. - -| Property | Type | Description | Example value | -| :----------- | :--------- | :---------------------------------------------------- | :------------------------------- | -| type | _string_ | the webhook type | `live-stream.broadcast.started` | -| emittedAt | _datetime_ | timestamp when the request was emitted from api.video | `2023-05-23T09:29:02.154104779Z` | -| liveStreamId | _string_ | the live stream id | `li3VbBGc4e6njqw7fRrELvKl` | - -### `live-stream.broadcast.ended` - -Triggers to indicate that a live stream broadcast has ended. - -| Property | Type | Description | Example value | -| :----------- | :--------- | :---------------------------------------------------- | :------------------------------- | -| type | _string_ | the webhook type | `live-stream.broadcast.ended` | -| emittedAt | _datetime_ | timestamp when the request was emitted from api.video | `2023-05-23T09:29:02.154104779Z` | -| liveStreamId | _string_ | the live stream id | `li3VbBGc4e6njqw7fRrELvKl` | - -### `video.source.recorded` - -Triggers to indicate that a live stream has completed and the recording of the live stream (if you set it to record) is ready to be transcoded. NOTE: This means the video has been enqueued for transcoding. - -| Property | Type | Description | Example value | -| :----------- | :--------- | :---------------------------------------------------- | :------------------------------- | -| type | _string_ | the webhook type | `video.source.recorded` | -| emittedAt | _datetime_ | timestamp when the request was emitted from api.video | `2023-05-23T09:29:02.154104779Z` | -| liveStreamId | _string_ | the live stream id | `li3VbBGc4e6njqw7fRrELvKl` | -| videoId | _string_ | the video id of the recorded stream | `viXXXXXXXX` | - -### `video.encoding.quality.completed` - -Triggers when you upload a video, every time api.video finishes encoding a video in a set quality (up to the same level of quality that you uploaded), you get an announcement about it. - -| Property | Type | Description | Example value | -| --------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- | -| type | _string_ | the webhook type | `video.encoding.quality.completed` | -| emittedAt | _datetime_ | timestamp when the request was emitted from api.video | `2023-05-23T09:29:02.154104779Z` | -| videoId | _string_ | The ID of the video that was encoded. | `viXXXXXXXX` | -| encoding | _string_ | The asset that the encoding was finished for. There are two types of assets that you will receive in the encoding:
- HLS
- MP4 | `hls` | -| `quality` | `string` | The quality of the video was transcoded to the current encoding.

The MP4 asset will only be transcoded once, hence you will receive a webhook only once for the MP4 asset with the final source quality. While the HLS asset webhook will be emitted multiple times with each quality (from the lowest 240p) to the highest of the source (up to 4k).

For example, if you've uploaded a video where the source quality is 720p. You will receive 5 webhooks in total:

- **1 webhook** with 720p quality for the MP4 encoding
- **4 webhooks** for 240p, 360p, 480p and 720p for the HLS encoding | `1080p` | - -## Implementation - -### Testing - -You can test your webhooks with tools like [Pipedream](https://pipedream.com/workflows). These tools enable you to test that api.video sends the correct webhook events, and ensure that webhooks arrive to your server. - -### Retry policy - -{% capture content %} -**📘 Webhook retry policy** - -api.video’s webhook service makes 3 notification attempts, with 3 second intervals between each try. -{% endcapture %} -{% include "_partials/callout.html" kind: "info", content: content %} - -### Choose an api.video client - -The clients offered by api.video include: - -- [Go](https://github.com/apivideo/api.video-go-client) -- [PHP](https://github.com/apivideo/api.video-php-client) -- [JavaScript ](https://github.com/apivideo/api.video-nodejs-client) -- [Python](https://github.com/apivideo/api.video-python-client) -- [C#](https://github.com/apivideo/api.video-csharp-client) - -To install your selected client, do the following: - -{% capture samples %} -```go -go get github.com/apivideo/api.video-go-client -``` -```php -composer require api-video/php-api-client -``` -```javascript -npm install @api.video/nodejs-client --save - -...or with yarn: - -yarn add @api.video/nodejs-client -``` -```python -pip install api.video -``` -```csharp -Using Nuget - -Install-Package ApiVideo -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -### Retrieve your API key - -You'll need your API key to get started. You can sign up for one here: [Get your api.video API key!](https://dashboard.api.video/register). - -### Create a webhook - -To create a webhook, all you have to do is set up your server and provide api.video with the URL you want events sent to and the list of events you wish to be sent to that URL. - -{% capture samples %} -```curl -curl --request POST \ - --url https://ws.api.video/webhooks \ - --header 'Accept: application/json' \ - --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NDI4MjQzMTkuMDk2NjY1LCJuYmYiOjE2NDI4MjQzMTkuMDk2NjY1LCJleHAiOjE2NDI4Mjc5MTkuMDk2NjY1LCJwcm9qZWN0SWQiOiJwclJ6SUpKQTdCTHNxSGpTNDVLVnBCMSJ9.rfchf3btbMTzSukcwhUS0u4fNY4Q3g1JpoMeIz_Dls1ADmqDdKw7yBOE893C7cagb0lpuvUJvhuhgusLStsJ4nqzTveDeM2oPBQBNJjzwaJZNrImTPD4mif7Tzgxvn1_jQJA5L4gQhjd7frCIJW1yAwywrtiDPbxiWNp8fVl7r_QILjZZfslxy-kblPrHJ20Zix9VURqkGIORY5G_457nHSV9Atks1sUlt49E8b_g3jORja3MnznXBS0-0dksz2K62-QMe1_dk78V9JwbLeydqcr15M1jDLA3H6qFGI7GTsTDdZ5jKLhg5OR6yeSHFysqr3kOteTqAGdp3JuTrpZIA' \ - --header 'Content-Type: application/json' \ - --data '{"events": [ - "live-stream.broadcast.started", "live-stream.broadcast.ended", "video.encoding.quality.completed" - ], - "url": "https://example.com/webhooks" -}' -``` -```go -package main - -import ( - "context" - "fmt" - "os" - apivideosdk "github.com/apivideo/api.video-go-client" -) - -func main() { - client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build() - // if you rather like to use the sandbox environment: - // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build() - - webhooksCreationPayload := *apivideosdk.NewWebhooksCreationPayload([]string{"Events_example"}, "https://example.com/webhooks") // WebhooksCreationPayload | - - - res, err := client.Webhooks.Create(webhooksCreationPayload) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.Create``: %v\n", err) - } - // response from `Create`: Webhook - fmt.Fprintf(os.Stdout, "Response from `Webhooks.Create`: %v\n", res) -} -``` -```php - -require __DIR__ .'/vendor/autoload.php'; - -use Symfony\Component\HttpClient\Psr18Client; -use ApiVideo\Client\Client; -use ApiVideo\Client\Model\VideosApi; -use ApiVideo\Client\Model\WebHooksApi; -$apiKey = 'your API key here'; -$apiVideoEndpoint = 'https://ws.api.video'; - -$httpClient = new \Symfony\Component\HttpClient\Psr18Client(); -$client = new ApiVideo\Client\Client( - $apiVideoEndpoint, - $apiKey, - $httpClient -); - -$payload = (new \ApiVideo\Client\Model\WebhooksCreationPayload())->setUrl('http://company.com')->setEvents(['video.encoding.quality.completed']); -$webhooks = $client->webhooks()->create($payload); -print($webhooks); - -``` -```javascript -//get the node-js library -const ApiVideoClient = require("@api.video/nodejs-client"); - -(async () => { - try { - const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" }); - const webhooksCreationPayload = { - events: ["video.encoding.quality.completed"], - url: "https://example.com/webhooks", - }; - // Webhook - const result = await client.webhooks.create(webhooksCreationPayload); - console.log(result); - } catch (e) { - console.error(e); - } -})(); -``` -```python -## Create a webhook -import apivideo -from apivideo.apis import WebhooksApi -from apivideo.exceptions import ApiAuthException - -api_key = "your api key here" - -client = apivideo.AuthenticatedApiClient(api_key) - -## If you'd rather use the sandbox environment: -## client = apivideo.AuthenticatedApiClient(api_key, production=False) - -client.connect() - -webhooks_api = WebhooksApi(client) - -## Create the webhooks payload -webhooks_creation_payload = { - "events": ["video.encoding.quality.completed"], - "url": "https://example.com/webhooks" -} - -## Create a webhook -response = webhooks_api.create(webhooks_creation_payload) -print(response) -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -### List all webhooks - -After you create webhooks, you can retrieve a complete list of the URLs and associated events going to them with this code sample: - -{% capture samples %} -```curl -curl --request GET \ - --url 'https://ws.api.video/webhooks?events=video.encoding.quality.completed¤tPage=1&pageSize=25' \ - --header 'Accept: application/json' \ - --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NDI4MjQzMTkuMDk2NjY1LCJuYmYiOjE2NDI4MjQzMTkuMDk2NjY1LCJleHAiOjE2NDI4Mjc5MTkuMDk2NjY1LCJwcm9qZWN0SWQiOiJwclJ6SUpKQTdCTHNxSGpTNDVLVnBCMSJ9.rfchf3btbMTzSukcwhUS0u4fNY4Q3g1JpoMeIz_Dls1ADmqDdKw7yBOE893C7cagb0lpuvUJvhuhgusLStsJ4nqzTveDeM2oPBQBNJjzwaJZNrImTPD4mif7Tzgxvn1_jQJA5L4gQhjd7frCIJW1yAwywrtiDPbxiWNp8fVl7r_QILjZZfslxy-kblPrHJ20Zix9VURqkGIORY5G_457nHSV9Atks1sUlt49E8b_g3jORja3MnznXBS0-0dksz2K62-QMe1_dk78V9JwbLeydqcr15M1jDLA3H6qFGI7GTsTDdZ5jKLhg5OR6yeSHFysqr3kOteTqAGdp3JuTrpZIA' -``` -```go -package main - -import ( - "context" - "fmt" - "os" - apivideosdk "github.com/apivideo/api.video-go-client" -) - -func main() { - client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build() - // if you rather like to use the sandbox environment: - // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build() - req := apivideosdk.WebhooksApiListRequest{} - - req.Events("video.encoding.quality.completed") // string | The webhook event that you wish to filter on. - 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.Webhooks.List(req) - - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.List``: %v\n", err) - } - // response from `List`: WebhooksListResponse - fmt.Fprintf(os.Stdout, "Response from `Webhooks.List`: %v\n", res) -} -``` -```php -webhooks()->list(); -print($webhooks); -``` -```javascript -const ApiVideoClient = require("@api.video/nodejs-client"); - -(async () => { - try { - const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" }); - - const events = "video.encoding.quality.completed"; // The webhook event that you wish to filter on. - const currentPage = "2"; // Choose the number of search results to return per page. Minimum value: 1 - const pageSize = "30"; // Results per page. Allowed values 1-100, default is 25. - - // WebhooksListResponse - const result = await client.webhooks.list({ - events, - currentPage, - pageSize, - }); - console.log(result); - } catch (e) { - console.error(e); - } -})(); -``` -```python -## List all webhooks -import apivideo -from apivideo.apis import WebhooksApi -from apivideo.exceptions import ApiAuthException - -api_key = "your api key here" - -client = apivideo.AuthenticatedApiClient(api_key) - -## If you'd rather use the sandbox environment: -## client = apivideo.AuthenticatedApiClient(api_key, production=False) - -client.connect() - -webhooks_api = WebhooksApi(client) - -## Create a webhook -response = webhooks_api.list() -print(response) -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -### Show a webhook - -You can retrieve details about a specific webhook, including the URL and associated events, by sending a request with the unique webhook ID using this code sample: - -{% capture samples %} -```curl -curl --request GET \ - --url https://ws.api.video/webhooks/webhook_XXXXXXXXXXXXXXX \ - --header 'Accept: application/json' \ - --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NDI4MjQzMTkuMDk2NjY1LCJuYmYiOjE2NDI4MjQzMTkuMDk2NjY1LCJleHAiOjE2NDI4Mjc5MTkuMDk2NjY1LCJwcm9qZWN0SWQiOiJwclJ6SUpKQTdCTHNxSGpTNDVLVnBCMSJ9.rfchf3btbMTzSukcwhUS0u4fNY4Q3g1JpoMeIz_Dls1ADmqDdKw7yBOE893C7cagb0lpuvUJvhuhgusLStsJ4nqzTveDeM2oPBQBNJjzwaJZNrImTPD4mif7Tzgxvn1_jQJA5L4gQhjd7frCIJW1yAwywrtiDPbxiWNp8fVl7r_QILjZZfslxy-kblPrHJ20Zix9VURqkGIORY5G_457nHSV9Atks1sUlt49E8b_g3jORja3MnznXBS0-0dksz2K62-QMe1_dk78V9JwbLeydqcr15M1jDLA3H6qFGI7GTsTDdZ5jKLhg5OR6yeSHFysqr3kOteTqAGdp3JuTrpZIA' -``` -```go -package main - -import ( - "context" - "fmt" - "os" - apivideosdk "github.com/apivideo/api.video-go-client" -) - -func main() { - client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build() - // if you rather like to use the sandbox environment: - // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build() - - webhookId := "webhookId_example" // string | The unique webhook you wish to retreive details on. - - - res, err := client.Webhooks.Get(webhookId) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.Get``: %v\n", err) - } - // response from `Get`: Webhook - fmt.Fprintf(os.Stdout, "Response from `Webhooks.Get`: %v\n", res) -} -``` -```php -webhooks()->get('webhook ID here'); -print($webhooks); -``` -```javascript -const ApiVideoClient = require("@api.video/nodejs-client"); - -(async () => { - try { - const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" }); - - const webhookId = "webhookId_example"; // The unique webhook you wish to retreive details on. - - // Webhook - const result = await client.webhooks.get(webhookId); - console.log(result); - } catch (e) { - console.error(e); - } -})(); -``` -```python -## List all webhooks -import apivideo -from apivideo.apis import WebhooksApi -from apivideo.exceptions import ApiAuthException - -api_key = "your api key here" - -client = apivideo.AuthenticatedApiClient(api_key) - -## If you'd rather use the sandbox environment: -## client = apivideo.AuthenticatedApiClient(api_key, production=False) - -client.connect() - -webhooks_api = WebhooksApi(client) - -## Create a webhook -response = webhooks_api.get("your webhook ID here") -print(response) -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -### Delete a webhook - -You can delete a webhook using its unique ID with this code sample: - -{% capture samples %} -```curl -curl --request DELETE \ - --url https://ws.api.video/webhooks/webhook_XXXXXXXXXXXXXXX \ - --header 'Accept: application/json' \ - --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE2NDI4MjQzMTkuMDk2NjY1LCJuYmYiOjE2NDI4MjQzMTkuMDk2NjY1LCJleHAiOjE2NDI4Mjc5MTkuMDk2NjY1LCJwcm9qZWN0SWQiOiJwclJ6SUpKQTdCTHNxSGpTNDVLVnBCMSJ9.rfchf3btbMTzSukcwhUS0u4fNY4Q3g1JpoMeIz_Dls1ADmqDdKw7yBOE893C7cagb0lpuvUJvhuhgusLStsJ4nqzTveDeM2oPBQBNJjzwaJZNrImTPD4mif7Tzgxvn1_jQJA5L4gQhjd7frCIJW1yAwywrtiDPbxiWNp8fVl7r_QILjZZfslxy-kblPrHJ20Zix9VURqkGIORY5G_457nHSV9Atks1sUlt49E8b_g3jORja3MnznXBS0-0dksz2K62-QMe1_dk78V9JwbLeydqcr15M1jDLA3H6qFGI7GTsTDdZ5jKLhg5OR6yeSHFysqr3kOteTqAGdp3JuTrpZIA' -``` -```go -package main - -import ( - "context" - "fmt" - "os" - apivideosdk "github.com/apivideo/api.video-go-client" -) - -func main() { - client := apivideosdk.ClientBuilder("YOUR_API_TOKEN").Build() - // if you rather like to use the sandbox environment: - // client := apivideosdk.SandboxClientBuilder("YOU_SANDBOX_API_TOKEN").Build() - - webhookId := "webhookId_example" // string | The webhook you wish to delete. - - - err := client.Webhooks.Delete(webhookId) - - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `Webhooks.Delete``: %v\n", err) - } -} -``` -```php -webhooks()->delete('webhook ID here'); -print($webhooks); -``` -```javascript -const ApiVideoClient = require("@api.video/nodejs-client"); - -(async () => { - try { - const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" }); - - const webhookId = "webhookId_example"; // The webhook you wish to delete. - - // void - const result = await client.webhooks.delete(webhookId); - console.log(result); - } catch (e) { - console.error(e); - } -})(); -``` -```python -## List all webhooks -import apivideo -from apivideo.apis import WebhooksApi -from apivideo.exceptions import ApiAuthException - -api_key = "your api key here" - -client = apivideo.AuthenticatedApiClient(api_key) - -## If you'd rather use the sandbox environment: -## client = apivideo.AuthenticatedApiClient(api_key, production=False) - -client.connect() - -webhooks_api = WebhooksApi(client) - -## Create a webhook -response = webhooks_api.delete("your webhook ID here") -print(response) -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -{% capture content %} -⚠️ **Warning** - -Deleting a webhook is a permanent action and deleted webhooks cannot be recovered. -{% endcapture %} -{% include "_partials/callout.html" kind: "warning", content: content %} - -## Next steps - -You can also use the **[Get video status](/reference/api/Videos#retrieve-video-status-and-details)** endpoint operation to check whether a video is uploaded and ready for playback. - -Visit the API reference for a complete list of **[webhook](/reference/api/Webhooks)** endpoint operations. diff --git a/templates/documentation/vod/creating-and-managing-chapters.md b/templates/documentation/vod/creating-and-managing-chapters.md index e6208817..9e37c379 100644 --- a/templates/documentation/vod/creating-and-managing-chapters.md +++ b/templates/documentation/vod/creating-and-managing-chapters.md @@ -1,6 +1,5 @@ --- -title: "Create and manage chapters" -slug: "create-manage-chapters" +title: Create and manage chapters meta: description: This page gets users started on how to add chapters to their videos using the api.video Chapters endpoint. --- diff --git a/templates/documentation/vod/delegated-upload-tokens.md b/templates/documentation/vod/delegated-upload-tokens.md index 6059d736..0a02b7e6 100644 --- a/templates/documentation/vod/delegated-upload-tokens.md +++ b/templates/documentation/vod/delegated-upload-tokens.md @@ -1,6 +1,5 @@ --- -title: "Delegated upload tokens" -slug: "delegated-upload-tokens" +title: Delegated upload tokens metadata: description: This guide explains how to create, list, retrieve, and delete delegated upload tokens, and how to upload videos with them. --- diff --git a/templates/documentation/vod/delete-a-video.md b/templates/documentation/vod/delete-a-video.md index de070ba0..c86a2739 100644 --- a/templates/documentation/vod/delete-a-video.md +++ b/templates/documentation/vod/delete-a-video.md @@ -1,8 +1,10 @@ --- -title: "Delete a video" +title: Delete a video +meta: + description: This guide walks you through how to permanently remove a video programmatically, and through the dashboard. --- -Delete A Video -============== + +# Delete A Video This guide walks you through how to permanently remove a video programmatically, and through the dashboard. Please be aware that you cannot retrieve a video you delete, so be sure it's what you want to do. diff --git a/templates/documentation/vod/demo-loom-clone.md b/templates/documentation/vod/demo-loom-clone.md index ef740c4b..2966c6a4 100644 --- a/templates/documentation/vod/demo-loom-clone.md +++ b/templates/documentation/vod/demo-loom-clone.md @@ -1,5 +1,7 @@ --- -title: "Loom mockup" +title: Loom mockup +meta: + description: This guide explains how to create a Loom-like application with api.video. --- # Loom clone diff --git a/templates/documentation/vod/demo-youtube-clone.md b/templates/documentation/vod/demo-youtube-clone.md index 277a9268..0b849cd3 100644 --- a/templates/documentation/vod/demo-youtube-clone.md +++ b/templates/documentation/vod/demo-youtube-clone.md @@ -1,5 +1,7 @@ --- -title: "YouTube clone" +title: YouTube clone +meta: + description: This guide explains how to create a YouTube-like application with api.video. --- # YouTube mockup diff --git a/templates/documentation/vod/demos-airbnb-clone.md b/templates/documentation/vod/demos-airbnb-clone.md index a7142848..fdca8fa2 100644 --- a/templates/documentation/vod/demos-airbnb-clone.md +++ b/templates/documentation/vod/demos-airbnb-clone.md @@ -1,5 +1,7 @@ --- -title: "Airbnb clone" +title: Airbnb clone +meta: + description: This guide explains how to create an Airbnb-like application with api.video. --- # Airbnb mockup diff --git a/templates/documentation/vod/demos-prog-upload-uploader.md b/templates/documentation/vod/demos-prog-upload-uploader.md index 75c490f9..74decbf0 100644 --- a/templates/documentation/vod/demos-prog-upload-uploader.md +++ b/templates/documentation/vod/demos-prog-upload-uploader.md @@ -1,5 +1,7 @@ --- -title: "Progressive video uploader" +title: Progressive video uploader +meta: + description: This guide explains how to create an application than can handle video recording and upload in real-time with api.video. --- # Progressive video uploader diff --git a/templates/documentation/vod/demos-template-overview.md b/templates/documentation/vod/demos-template-overview.md index c09d77da..f3942bc4 100644 --- a/templates/documentation/vod/demos-template-overview.md +++ b/templates/documentation/vod/demos-template-overview.md @@ -1,3 +1,9 @@ +--- +title: Demos & templates +meta: + description: This page lists demo applications and templates that you can use to develop your own video solution using api.video. +--- + # Demos & Templates The amount of use cases you can build with [api.video](https://api.video/) is endless, however, sometimes, you need a little help in building your next amazing startup! That’s why we’ve created Templates to help you kickstart your application, without doing all the heavy lifting. @@ -13,7 +19,7 @@ The Templates are structured in a way where you can: ## VOD Templates list -* [Video uploader](/vod/upload-your-first-video.md) +* [Video uploader](/vod/demos-video-uploader.md) * [Progressive video uploader](/vod/demos-prog-upload-uploader.md) * [Loom clone](/vod/demo-loom-clone.md) * [Youtube mockup](/vod/demo-youtube-clone.md) diff --git a/templates/documentation/vod/demos-tiktok-clone.md b/templates/documentation/vod/demos-tiktok-clone.md index e627a7eb..8899afde 100644 --- a/templates/documentation/vod/demos-tiktok-clone.md +++ b/templates/documentation/vod/demos-tiktok-clone.md @@ -1,5 +1,7 @@ --- -title: "TikTok clone" +title: TikTok clone +meta: + description: This guide explains how to create a TikTok-like application with api.video. --- # TikTok mockup diff --git a/templates/documentation/vod/demos-udemy-clone.md b/templates/documentation/vod/demos-udemy-clone.md index c95ebb56..e36315c5 100644 --- a/templates/documentation/vod/demos-udemy-clone.md +++ b/templates/documentation/vod/demos-udemy-clone.md @@ -1,5 +1,7 @@ --- -title: "Udemy clone" +title: Udemy clone +meta: + description: This guide explains how to create a Udemy-like application with api.video. --- # Udemy mockup diff --git a/templates/documentation/vod/demos-video-uploader.md b/templates/documentation/vod/demos-video-uploader.md index c4e1bed6..94cace0f 100644 --- a/templates/documentation/vod/demos-video-uploader.md +++ b/templates/documentation/vod/demos-video-uploader.md @@ -1,5 +1,7 @@ --- -title: "Video uploader" +title: Video uploader +meta: + description: This guide explains how to create a backend application than can handle video uploads with api.video. --- # Video uploader diff --git a/templates/documentation/vod/downloading-videos.md b/templates/documentation/vod/downloading-videos.md deleted file mode 100644 index 3c5bfcff..00000000 --- a/templates/documentation/vod/downloading-videos.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Downloading videos" -slug: "downloading-videos" -metadata: - title: "Downloading videos • api.video Documentation" - description: "TBA" ---- - -Downloading videos -========== - -TBA \ No newline at end of file diff --git a/templates/documentation/vod/encoding-transcoding.md b/templates/documentation/vod/encoding-transcoding.md index 1a97ebe5..c96f13a3 100644 --- a/templates/documentation/vod/encoding-transcoding.md +++ b/templates/documentation/vod/encoding-transcoding.md @@ -1,9 +1,7 @@ --- -title: "Encoding and transcoding" -slug: "encoding-transcoding" -metadata: - title: "Encoding and transcoding • api.video Documentation" - description: "This guide explains what video encoding and transcoding means and how api.video enables you to provide your users high quality videos via encoding and transcoding." +title: Encoding and transcoding +metadata: + description: This guide explains what video encoding and transcoding means and how api.video enables you to provide your users high quality videos via encoding and transcoding. --- ## Encoding diff --git a/templates/documentation/vod/get-started-in-5-minutes.md b/templates/documentation/vod/get-started-in-5-minutes.md index 6cd3e229..f162dc23 100644 --- a/templates/documentation/vod/get-started-in-5-minutes.md +++ b/templates/documentation/vod/get-started-in-5-minutes.md @@ -1,8 +1,10 @@ --- -title: "Get Started with VOD in 5 Minutes" +title: Get Started with VOD in 5 Minutes +meta: + description: This quickstart guide explains the concept of building a video uploader and a video listing on the same page in just a few steps. --- -Get Started In 5 Minutes -======================== + +# Get Started In 5 Minutes In order to get the concept of building on top of api.video, we've created a get started guide that will show you the concept of building a video uploader and a video listing on the same page. diff --git a/templates/documentation/vod/google-cold-storage-backup.md b/templates/documentation/vod/google-cold-storage-backup.md index 580be06a..b034c69f 100644 --- a/templates/documentation/vod/google-cold-storage-backup.md +++ b/templates/documentation/vod/google-cold-storage-backup.md @@ -1,9 +1,9 @@ --- -title: "Backup your videos to Google Storage account" -slug: "google-cold-storage-backup" +title: Backup your videos to Google Storage account meta: - description: Backup videos uploaded to api.video to Google Storage account with a simple script. + description: Backup videos uploaded to api.video to Google Storage account with a simple script. --- + # Video backup to Google Storage account At [api.video](https://api.video/) we understand that sometimes, you want to make sure that your videos are safe and secure. Although api.video has a backup and disaster recovery plan, it’s up to you to decide if you want an extra backup resource or if you would like to use api.video just to transcode your videos but eventually store them on a different resource. diff --git a/templates/documentation/vod/list-videos-2.md b/templates/documentation/vod/list-videos-2.md index 1badd33e..46d28183 100644 --- a/templates/documentation/vod/list-videos-2.md +++ b/templates/documentation/vod/list-videos-2.md @@ -1,9 +1,10 @@ --- -title: "List videos" +title: List videos +meta: + description: This guide walks through the different options for retrieving videos and covers a method for searching for them using your dashboard. --- -List Videos -=========== +# List Videos You will often need to retrieve a list of all your videos or some videos to work with them. You might need to do this on the fly to see what you have, or you might want to pull the list into a database you can then pull from to create different kinds of displays. There are two ways to retrieve your videos: diff --git a/templates/documentation/vod/progressive-upload.md b/templates/documentation/vod/progressive-upload.md index ecf86f41..a4151254 100644 --- a/templates/documentation/vod/progressive-upload.md +++ b/templates/documentation/vod/progressive-upload.md @@ -1,8 +1,10 @@ --- -title: "Progressive video upload" +title: Progressive video upload +meta: + description: This guide walks through how progressive video upload works with api.video. --- -Progressive video upload -============================= + +# Progressive video upload api.video provides different ways to upload your videos. There are two ways to upload with tokens, and then there are two ways to upload depending on whether your video is over 200MB or under. This guide walks through how to do progressive video upload. Options covered in this guide include: diff --git a/templates/documentation/vod/show-video-details.md b/templates/documentation/vod/show-video-details.md index c42c7aef..13c25428 100644 --- a/templates/documentation/vod/show-video-details.md +++ b/templates/documentation/vod/show-video-details.md @@ -1,9 +1,10 @@ --- -title: "Show video details" +title: Show video details +meta: + description: This guide explains how retrieve video details programmatically and through the api.video dashboard. --- -Show Video Details -================== +# Show Video Details You can retrieve details for a specific video if you have the video ID. In this guide, we'll walk through the code to retrieve it and how to retrieve it from the dashboard. diff --git a/templates/documentation/vod/show-video-upload-status.md b/templates/documentation/vod/show-video-upload-status.md index 74d81574..e1155d8e 100644 --- a/templates/documentation/vod/show-video-upload-status.md +++ b/templates/documentation/vod/show-video-upload-status.md @@ -1,8 +1,10 @@ --- -title: "Video status & details" +title: Video status & details +meta: + description: This guide explains how retrieve the video upload and encoding status programmatically via the API and through webhooks. --- -Video status & details -====================== + +# Video status & details api.video gives you ways of checking the video upload status and video details. diff --git a/templates/documentation/vod/update-video-details.md b/templates/documentation/vod/update-video-details.md index 0f2339bd..4c8965d8 100644 --- a/templates/documentation/vod/update-video-details.md +++ b/templates/documentation/vod/update-video-details.md @@ -1,8 +1,10 @@ --- -title: "Update video details" +title: Update video details +meta: + description: This guide explains the two methods you can use to update videos - programmatically and through the dashboard. --- -Update Video Details -==================== + +# Update Video Details You can update details for a video after you've uploaded it. The only things you can't change are the video ID, the content of the video, and the watermark. This guide walks through two ways you can make an update - programmatically and through the dashboard. diff --git a/templates/documentation/vod/upload-a-video-regular-upload.md b/templates/documentation/vod/upload-a-video-regular-upload.md index 159dde6a..5b0639e7 100644 --- a/templates/documentation/vod/upload-a-video-regular-upload.md +++ b/templates/documentation/vod/upload-a-video-regular-upload.md @@ -1,8 +1,10 @@ --- -title: "Regular video upload" +title: Regular video upload +meta: + description: This guide walks through how to upload videos under 200MiB in size programmatically with api.video. --- -Regular video upload -============================= + +# Regular video upload api.video provides different ways to upload your videos. There are two ways to upload with tokens, and then there are two ways to upload depending on whether your video is over 200MiB or under. This guide walks through how to do regular video upload for a video under 200MiB in size. diff --git a/templates/documentation/vod/upload-from-source.md b/templates/documentation/vod/upload-from-source.md index 31b64f20..9622502c 100644 --- a/templates/documentation/vod/upload-from-source.md +++ b/templates/documentation/vod/upload-from-source.md @@ -1,5 +1,7 @@ --- -title: "Upload video from source" +title: Upload video from source +meta: + description: This guide walks through how to clone one of your existing videos, and upload videos via a URL with api.video. --- # Upload video from source diff --git a/templates/documentation/vod/upload-your-first-video.md b/templates/documentation/vod/upload-your-first-video.md deleted file mode 100644 index 3d4c49a9..00000000 --- a/templates/documentation/vod/upload-your-first-video.md +++ /dev/null @@ -1,532 +0,0 @@ ---- -title: "Upload your first video" -slug: "upload-your-first-video" -excerpt: "In this guide, you will learn how to upload your first video to api.video, and play it back." -hidden: false -metadata: - title: "Video uploader" - description: "Upload your videos in minutes with api.video. Blazing fast delivery and low cost hosting." -createdAt: "2022-05-24T08:37:34.962Z" -updatedAt: "2023-05-24T10:34:39.667Z" ---- -Upload Your First Video -======================= - -## 1. Create an **[api.video](https://api.video/) account** - -Before you can start uploading your first video, you need to [create an account](https://dashboard.api.video/register). - -Once you are logged in to dashboard.api.video, select the environment of your choice (sandbox or production), and copy your API key. - -## 2. Upload a video - -You can choose to upload a video [from your computer](#upload-a-file-from-your-computer), or [from a URL](#upload-a-file-from-a-url). - -### Upload a file from your computer - -![Uploading a video via the API or from your computer](/_assets/upload-a-file.png) - -#### a. Create the video object - -The first step to uploading a video is to create a video object. -Once you create the object, you can use it to upload a video. Here is the basic minimal code to create the object: - -{% capture samples %} -```curl -curl --user *your_api_key*: \ ---request POST \ ---url https://ws.api.video/videos \ ---header 'Content-Type: application/json' \ ---data ' -{ - "title": "My First Video" -} -' -``` -```javascript -// First install the "@api.video/nodejs-client" npm package -// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#create - -const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" }); - -const video = await client.videos.create({ title: "My First Video" }); -``` -```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/VideosApi.md#create - -$client = new \ApiVideo\Client\Client( - 'https://ws.api.video', - 'YOUR_API_KEY', - new \Symfony\Component\HttpClient\Psr18Client() -); - -$video = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload()) - ->setTitle("My First Video")); -``` -```java -// 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 - -ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); - -VideoCreationPayload videoCreationPayload = new VideoCreationPayload(); -videoCreationPayload.setTitle("My First Video"); - -try { - Video video = client.videos().create(videoCreationPayload); -} catch (ApiException e) { - // Manage error here -} -``` -```kotlin -// First add the "video.api:android-api-client" maven dependency to your project -// Documentation: https://github.com/apivideo/api.video-android-client/blob/main/docs/VideosApi.md#create - -val client = ApiVideoClient("YOUR_API_KEY") - -val videoCreationPayload = VideoCreationPayload() -videoCreationPayload.title = "My First Video" - -try { - val video = client.videos().create(videoCreationPayload) -} catch (e: ApiException) { - // Manage error here -} -``` -```python -## First install the api client with "pip install api.video" -## Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#create - -from apivideo.api.videos_api import VideosApi -from apivideo.model.video_creation_payload import VideoCreationPayload -from apivideo import AuthenticatedApiClient, ApiException - -with AuthenticatedApiClient("YOUR_API_KEY") as api_client: - video_creation_payload = VideoCreationPayload( - title="My First Video" - ) - - try: - video = VideosApi(api_client).create(video_creation_payload) - except ApiException as e: - # Manage error here -``` -```go -// 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/Videos.md#Create - -client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build() - -videoCreationPayload := apivideosdk.VideoCreationPayload{} -videoCreationPayload.SetTitle("My First Video") - -video, err := client.Videos.Create(videosCreationPayload) - -if video != nil { - // Manage error here -} -``` -```swift -// 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/VideosAPI.md#create - -ApiVideoClient.apiKey = "YOUR_API_KEY" - -let videoCreationPayload = VideoCreationPayload( - title: "My First Video" -) - -VideosAPI.create(videoCreationPayload: videoCreationPayload) { video, error in - if let video = video { - // Do something with the video - } - if let error = error { - // Manage error here - } -} -``` -```c# -// First add the "ApiVideo" NuGet package to your project -// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#create - -var apiVideoClient = new ApiVideoClient("YOUR_API_KEY"); - -var videoCreationPayload = new VideoCreationPayload() -{ - title = "My First Video" -}; - -try -{ - var video = apiVideoClient.Videos().create(videoCreationPayload); -} -catch (ApiException e) -{ - // Manage error here -} -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -{% capture content %} -Replace `your_api_key` by the key you have already copied from dashboard.api.video -{% endcapture %} -{% include "_partials/callout.html" kind: "info", content: content %} - -The response to your API request will return the following, along with other params: - -```json -{ - "videoId": "your_video_id_here", - "assets": { - ... - "player": "https://embed.api.video/vod/{videoId}", - ... - } -} -``` - -Remember the `videoId`: you will need it to upload your video, in [step b](#b-upload-the-file-into-the-video-object). -Also, you will need the `assets.player` to playback your video in [step 3](#3-watch-your-video). - -{% capture content %} -If you are using one of our API clients, you will find the above information in the returned response's `Video` object. -{% endcapture %} -{% include "_partials/callout.html" kind: "info", content: content %} - -#### b. Upload the file into the video object - -In the first step, you created the video object. Now, we enter the second step: you have to upload the video file into the video object. The below API request will do this for you. - -{% capture samples %} -```curl -curl --user *your_api_key*: ---url https://ws.api.video/videos/{videoId}/source ---form file=@/path/to/video.mp4 -``` -```javascript -// First install the "@api.video/nodejs-client" npm package -// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#upload - -const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" }); - -// Enter the videoId you want to use to upload your video. -const videoId = 'YOUR_VIDEO_ID'; - -// The path to the video you would like to upload. The path must be local. -// Instead of a path, you can also use a Readable object, or Buffer. -const file = './my-video.mp4'; - -const video = await client.videos.upload(videoId, file); -``` -```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/VideosApi.md#upload---upload-a-video - -$client = new \ApiVideo\Client\Client( - 'https://ws.api.video', - 'YOUR_API_KEY', - new \Symfony\Component\HttpClient\Psr18Client() -); - -$client->videos()->upload('YOUR_VIDEO_ID', new SplFileObject(__DIR__ . '/my-video.mp4')); -``` -```java -// 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/VideosApi.md#upload - -ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); - -try { - Video video = client.videos().upload("YOUR_VIDEO_ID", new File("/path/to/my-video.mp4")); - System.out.println(video); -} catch (ApiException e) { - // Manage error here -} -``` -```kotlin -// First add the "video.api:android-api-client" maven dependency to your project -// Documentation: https://github.com/apivideo/api.video-android-client/blob/main/docs/VideosApi.md#upload - -val client = ApiVideoClient("YOUR_API_KEY") - -try { - // Notice: you must not call API from the UI/main thread. Dispatch with Thread, Executors or Kotlin coroutines. - val video = client.videos().upload("YOUR_VIDEO_ID", File("/path/to/my-video.mp4")) -} catch (e: ApiException) { - // Manage error here -} -``` -```python -## First install the api client with "pip install api.video" -## Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#upload - -import apivideo -from apivideo.api import videos_api -from apivideo.model.video import Video - -with apivideo.AuthenticatedApiClient("YOUR_API_KEY") as api_client: - video_id = "YOUR_VIDEO_ID" # Enter the videoId you want to use to upload your video. - video_file = open("/path/to/my-video.mp4", "rb") # The path to the video you would like to upload. The path must be local. - - try: - video = videos_api.VideosApi(api_client).upload(video_id, video_file) - except ApiException as e: - # Manage error here -``` -```go -// 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/Videos.md#Upload - -client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build() - -videoId := "YOUR_VIDEO_ID" -file, _ := os.Open("./my-video.mp4") - -video, err := client.Videos.UploadFile(videoId, file) - -if err != nil { - // Manage error here -} -``` -```swift -// 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/VideosAPI.md#upload - -ApiVideoClient.apiKey = "YOUR_API_KEY" - -VideosAPI.upload(videoId: "YOUR_VIDEO_ID", file: URL(string: "./my-video.mov")) { video, error in - if let video = video { - // Manage upload success here - } - if let error = error { - // Manage upload error here - } - } -``` -```csharp -// First add the "ApiVideo" NuGet package to your project -// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#Upload - -var apiVideoClient = new ApiVideoClient("YOUR_API_KEY"); - -var videoFile = File.OpenRead("./my-video.mp4"); - -try -{ - var video = apiVideoClient.Videos().upload("YOUR_VIDEO_ID", videoFile) -} -catch (ApiException e) -{ - // Manage error here -} -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -API response - -```json -{ - "videoId": "your_video_id_here", - "assets": { - ... - "player": "https://embed.api.video/vod/{videoId}", - ... - } -} -``` - -### Upload a file from a URL - -#### Create the video object - -Uploading a video from a video URL allows you to do the whole video upload process in only 1 step. Just paste your video URL as a source. The request below shows you how to do it. - -{% capture samples %} -```curl -curl --user *your_api_key*: \ ---request POST \ ---url https://ws.api.video/videos \ ---header 'Content-Type: application/json' \ ---data ' -{ - "title": "My First Video", - "source": "https://www.myvideourl.com/video.mp4" -} -' -``` -```javascript -// First install the "@api.video/nodejs-client" npm package -// Documentation: https://github.com/apivideo/api.video-nodejs-client/blob/main/doc/api/VideosApi.md#create - -const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" }); - -const video = await client.videos.create({ - title: "My First Video", - source: "https://www.myvideourl.com/video.mp4" -}); -``` -```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/VideosApi.md#create - -$client = new \ApiVideo\Client\Client( - 'https://ws.api.video', - 'YOUR_API_KEY', - new \Symfony\Component\HttpClient\Psr18Client() -); - -$video = $client->videos()->create((new \ApiVideo\Client\Model\VideoCreationPayload()) - ->setTitle("My First Video") - ->setSource("https://www.myvideourl.com/video.mp4")); -``` -```java -// 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 - -ApiVideoClient client = new ApiVideoClient("YOUR_API_KEY"); - -VideoCreationPayload videoCreationPayload = new VideoCreationPayload(); -videoCreationPayload.setTitle("My First Video"); -videoCreationPayload.setSource("https://www.myvideourl.com/video.mp4"); - -try { - Video video = client.videos().create(videoCreationPayload); -} catch (ApiException e) { - // Manage error here -} -``` -```kotlin -// First add the "video.api:android-api-client" maven dependency to your project -// Documentation: https://github.com/apivideo/api.video-android-client/blob/main/docs/VideosApi.md#create - -val client = ApiVideoClient("YOUR_API_KEY") - -val videoCreationPayload = VideoCreationPayload() -videoCreationPayload.title = "My First Video" -videoCreationPayload.source = "https://www.myvideourl.com/video.mp4" - -try { - val video = client.videos().create(videoCreationPayload) -} catch (e: ApiException) { - // Manage error here -} -``` -```python -## First install the api client with "pip install api.video" -## Documentation: https://github.com/apivideo/api.video-python-client/blob/main/docs/VideosApi.md#create - -from apivideo.api.videos_api import VideosApi -from apivideo.model.video_creation_payload import VideoCreationPayload -from apivideo import AuthenticatedApiClient, ApiException - -with AuthenticatedApiClient("YOUR_API_KEY") as api_client: - video_creation_payload = VideoCreationPayload( - title="My First Video", - source="https://www.myvideourl.com/video.mp4" - ) - - try: - video = VideosApi(api_client).create(video_creation_payload) - except ApiException as e: - # Manage error here -``` -```go -// 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/Videos.md#Create - -client := apivideosdk.ClientBuilder("YOUR_API_KEY").Build() - -videoCreationPayload := apivideosdk.VideoCreationPayload{} -videoCreationPayload.SetTitle("My First Video") -videoCreationPayload.SetSource("https://www.myvideourl.com/video.mp4") - -video, err := client.Videos.Create(videosCreationPayload) - -if video != nil { - // Manage error here -} -``` -```swift -// 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/VideosAPI.md#create - -ApiVideoClient.apiKey = "YOUR_API_KEY" - -let videoCreationPayload = VideoCreationPayload( - title: "My First Video", - source: "https://www.myvideourl.com/video.mp4" -) - -VideosAPI.create(videoCreationPayload: videoCreationPayload) { video, error in - if let video = video { - // Do something with the video - } - if let error = error { - // Manage error here - } -} -``` -```csharp -// First add the "ApiVideo" NuGet package to your project -// Documentation: https://github.com/apivideo/api.video-csharp-client/blob/main/docs/VideosApi.md#create - -var apiVideoClient = new ApiVideoClient("YOUR_API_KEY"); - -var videoCreationPayload = new VideoCreationPayload() -{ - title = "My First Video", - source = "https://www.myvideourl.com/video.mp4" -}; - -try -{ - var video = apiVideoClient.Videos().create(videoCreationPayload); -} -catch (ApiException e) -{ - // Manage error here -} -``` -{% endcapture %} -{% include "_partials/code-tabs.md" samples: samples %} - -{% capture content %} -Replace the link in the example above with your video URL. If you don’t have a video URL to test this, you can use [this one](http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4) for example. -{% endcapture %} -{% include "_partials/callout.html" kind: "info", content: content %} - -API response - -```json -{ - "videoId": "your_video_id_here", - "assets": { - ... - "player": "https://embed.api.video/vod/{videoId}", - ... - } -} -``` - -## 3. Watch your video - -The easiest way to play your video is to use the [api.video](https://api.video/) player URL that you received in [step 2](#2-upload-a-video): - -`"player": "https://embed.api.video/vod/{videoId}"` - -To watch your video, just paste the link into your favorite browser. - -## 4. Manage your video - -You can do many things to manage existing videos in your [api.video](https://api.video/) environment, among which: - -- [Update a video](/reference/api/Videos#update-a-video-object) (API) -- [List all videos](/reference/api/Videos#list-all-video-objects) (API) -- [Delete a video](/reference/api/Videos#delete-a-video-object) (API) -- [Upload a thumbnail to a video](/reference/api/Videos#upload-a-thumbnail) (API) -- [Pick a thumbnail for a video](/reference/api/Videos#set-a-thumbnail) (API) -- [Retrieve a video](/reference/api/Videos#retrieve-a-video-object) (API) -- [Retrieve a video status](/reference/api/Videos#retrieve-video-status-and-details) (API) diff --git a/templates/documentation/vod/video-best-practices.md b/templates/documentation/vod/video-best-practices.md index 363c28cb..163ad19a 100644 --- a/templates/documentation/vod/video-best-practices.md +++ b/templates/documentation/vod/video-best-practices.md @@ -1,5 +1,10 @@ -Video best practices -==================== +--- +title: Video best practices +meta: + description: This guide provides best practices, limitations, and recommendations on how to work with video on demand via api.video. +--- + +# Video best practices ## How to create & upload a video diff --git a/templates/documentation/vod/video-download.md b/templates/documentation/vod/video-download.md index 5240a138..f31ba9b9 100644 --- a/templates/documentation/vod/video-download.md +++ b/templates/documentation/vod/video-download.md @@ -1,6 +1,5 @@ --- -title: "Download & disable download with api.video" -slug: "downlad-video" +title: Download & disable download with api.video meta: description: With api.video you can control whether your users can download videos. --- diff --git a/templates/documentation/vod/video-management-basics.md b/templates/documentation/vod/video-management-basics.md index efd1e54b..d7a937d0 100644 --- a/templates/documentation/vod/video-management-basics.md +++ b/templates/documentation/vod/video-management-basics.md @@ -1,12 +1,10 @@ --- -title: "Video management basics" -slug: "video-management-basics" +title: Video management basics meta: description: This page serves as a foundational guide to the different operations using api.video's solutions for video on demand (VOD). These are list videos, show and update video details, add thumbnail to videos, and delete videos. --- -Video management basics -==================== +# Video management basics This page serves as a foundational guide to the different operations you can use in api.video's solutions for video on demand (VOD). diff --git a/templates/documentation/vod/video-object.md b/templates/documentation/vod/video-object.md index 75d4089f..1f1ff57c 100644 --- a/templates/documentation/vod/video-object.md +++ b/templates/documentation/vod/video-object.md @@ -1,13 +1,9 @@ --- -title: "What is a video object?" -slug: video-object -hidden: false +title: What is a video object? metadata: - title: "What is a video object?" - description: "Short guide to explain what api.video objects are." + description: Short guide to explain what api.video objects are. --- - # What is a video object? The video object in reference to api.video is a container of sort (not to be confused with [video container](https://headendinfo.com/video-container/)) for the video that you upload. diff --git a/templates/documentation/vod/video-playback-features.md b/templates/documentation/vod/video-playback-features.md index 19566113..5235a5f2 100644 --- a/templates/documentation/vod/video-playback-features.md +++ b/templates/documentation/vod/video-playback-features.md @@ -1,10 +1,7 @@ --- -title: "HTML5 Player URL Fragments" -slug: "video-playback-features" -hidden: false +title: HTML5 Player URL Fragments metadata: - title: "HTML5 Player URL Fragments • api.video Documentation" - description: "URL fragments let you complete the api.video embed source URL with query parameters introduced by a hash (#). The HTML5 Player URL Fragments page shows you how to use them with your project." + description: URL fragments let you complete the api.video embed source URL with query parameters introduced by a hash (#). The HTML5 Player URL Fragments page shows you how to use them with your project. --- HTML5 Player URL Fragments diff --git a/templates/documentation/vod/video-tagging.md b/templates/documentation/vod/video-tagging.md index e02113d6..d20c9beb 100644 --- a/templates/documentation/vod/video-tagging.md +++ b/templates/documentation/vod/video-tagging.md @@ -1,12 +1,9 @@ --- -title: "Video tagging" -slug: "video-tagging" +title: Video tagging metadata: - title: "Video tagging • api.video Documentation" - description: "TBA" + description: TBA --- -Video tagging -========== +# Video tagging TBA \ No newline at end of file