Skip to content

Commit

Permalink
Merge pull request #30 from apivideo/add-player-theme-name
Browse files Browse the repository at this point in the history
feat(all): a name property in player themes
  • Loading branch information
bot-api-video authored Dec 6, 2021
2 parents 654f50e + 9b8d442 commit 4447d96
Show file tree
Hide file tree
Showing 13 changed files with 296 additions and 62 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog
All changes to this project will be documented in this file.

## [1.0.1] - 2021-12-06
- Add `name` attribute in player themes

## [1.0.0] - 2021-11-15
- Add support of `progressive uploads`
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**Delete**](docs/PlayerThemes.md#Delete) | **Delete** /players/{playerId} | Delete a player
[**DeleteLogo**](docs/PlayerThemes.md#DeleteLogo) | **Delete** /players/{playerId}/logo | Delete logo
[**List**](docs/PlayerThemes.md#List) | **Get** /players | List all players
[**List**](docs/PlayerThemes.md#List) | **Get** /players | List all player themes
[**Get**](docs/PlayerThemes.md#Get) | **Get** /players/{playerId} | Show a player
[**Update**](docs/PlayerThemes.md#Update) | **Patch** /players/{playerId} | Update a player
[**Create**](docs/PlayerThemes.md#Create) | **Post** /players | Create a player
Expand Down
97 changes: 70 additions & 27 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -692,20 +692,21 @@ paths:
}
/videos/{videoId}/source:
post:
description: |-
To upload a video to the videoId you created. Replace {videoId} with the id you'd like to use, {access_token} with your token, and /path/to/video.mp4 with the path to the video you'd like to upload. You can only upload your video to the videoId once.\nWe offer 2 types of upload:
* Regular uploads
* Progressive uploads
The latter allows you to split a video source into X chunks and send those chunks independently (concurrently or sequentially). The 2 main goals for our users are to
* (1) allow the upload of video sources > 200 MiB (200 MiB = the max. allowed file size for regular upload)
* (2) allow to send a video source "progressively", i.e., before before knowing the total size of the video.\nOnce all chunks have been sent, they are reaggregated to one source file. The video source is considered as "completely sent" when the "last" chunk is sent (i.e., the chunk that "completes" the upload).
```bash
curl https://ws.api.video/videos/{videoId}/source \
-H 'Authorization: Bearer {access_token}' \
-F file=@/path/to/video.mp4

```
Tutorials using [video upload](https://api.video/blog/endpoints/video-upload).
description: "To upload a video to the videoId you created. Replace {videoId}\
\ with the id you'd like to use, {access_token} with your token, and /path/to/video.mp4\
\ with the path to the video you'd like to upload. You can only upload your\
\ video to the videoId once.\nWe offer 2 types of upload: \n* Regular upload\
\ \n* Progressive upload\nThe latter allows you to split a video source into\
\ X chunks and send those chunks independently (concurrently or sequentially).\
\ The 2 main goals for our users are to\n * allow the upload of video sources\
\ > 200 MiB (200 MiB = the max. allowed file size for regular upload)\n *\
\ allow to send a video source \"progressively\", i.e., before before knowing\
\ the total size of the video.\n Once all chunks have been sent, they are\
\ reaggregated to one source file. The video source is considered as \"completely\
\ sent\" when the \"last\" chunk is sent (i.e., the chunk that \"completes\"\
\ the upload).\n```bash\ncurl https://ws.api.video/videos/{videoId}/source\
\ \\\n -H 'Authorization: Bearer {access_token}' \\\n -F file=@/path/to/video.mp4\n\
\n ```\nTutorials using [video upload](https://api.video/blog/endpoints/video-upload)."
operationId: POST_videos-videoId-source
parameters:
- description: Enter the videoId you want to use to upload your video.
Expand All @@ -717,16 +718,40 @@ paths:
schema:
type: string
style: simple
- description: |
Content-Range can be used if you want to split your file. You can do this by parts, or by chunk.
* If you split your file by bytes, bear in mind byte ranges are inclusive, meaning that bytes 0-5242880 represents the first 5,242,880 bytes in a file or object.\nAlso, the Content-Range header value must match the following pattern: bytes <from_byte>-<to_byte>/<total_bytes>:
* <from_byte> is a positive integer or 0. It represents the range start (aka lower bound), i.e., the first byte of the chunk compared to the total bytes composing the full video source. The first sequential range always starts at 0.
* <to_byte> is a positive integer representing the range end (aka upper bound), i.e., the last byte of the chunk compared to the total bytes composing the full video source.
* <total_bytes> is a positive integer representing the total bytes composing the full video source. It can also be * if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests.
* If you split your file by part (recommended option), the `Content-Range` header value must match the following pattern: `part <part>/<total_parts>`:
* `<part>` is a positive integer representing the part number. The first sequential part number is always 1.
* `<total_parts>` is a positive integer representing the total parts of the video source. It can also be `*` if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests.
example: bytes 209715200-419430399/52428800 OR part 2/3
- description: "Content-Range can be used if you want to split your file. You\
\ can do this by parts, or by chunk.\n* If you split your file by parts\
\ (recommended option), the `Content-Range` header value must match the\
\ following pattern: `part <part>/<total_parts>`:\n * `<part>` is a positive\
\ integer representing the part number. The first sequential part number\
\ is always 1.\n * `<total_parts>` is a positive integer representing the\
\ total parts of the video source. It can also be `*` if or as long as it\
\ is unknown. Technically, this value is required only one time and cannot\
\ differ in several requests.\n* If you split your file by bytes, bear in\
\ mind byte ranges are inclusive, meaning that bytes 0-5242879 represents\
\ the first 5,242,880 bytes in a file or object. Also, the Content-Range\
\ header value must match the following pattern: `bytes <from_byte>-<to_byte>/<total_bytes>`:\n\
\ * `<from_byte>` is a positive integer or 0. It represents the range start\
\ (aka lower bound), i.e., the first byte of the chunk compared to the total\
\ bytes composing the full video source. The first sequential range always\
\ starts at 0.\n * `<to_byte>` is a positive integer representing the range\
\ end (aka upper bound), i.e., the last byte of the chunk compared to the\
\ total bytes composing the full video source.\n * `<total_bytes>` is a\
\ positive integer representing the total bytes composing the full video\
\ source. It can also be `*` if or as long as it is unknown. Technically,\
\ this value is required only one time and cannot differ in several requests.\n\
* Ordering and chunk or part size\n * The order in which the chunks are\
\ received on our side does not matter. \n * Example: `part 3/*` then\
\ `part 2/*` then `part 1/3` works.\n * The chunks can be sent concurrently.\
\ We have a lock mechanism to ensure they are still technically processed\
\ one by one to ensure the \"completion\" check behaves as expected.\n \
\ * The only chunk that can be smaller than our minimum allowed chunk size\
\ (5 MiB) is the last sequential one (i.e., the last sequential range for\
\ the \"byte-range\" system and the last part for the \"part\" system.\n\
\ * For instance, if your video is 10.5 MiB big, your last chunk would\
\ be 500 KiB, and that would work. \n * Another example is if your video\
\ is 2 MiB big, then your first and last chunk will be 2MiB and that will\
\ work as well.\n"
example: bytes 209715200-419430399/524288000 OR part 2/3
explode: false
in: header
name: Content-Range
Expand Down Expand Up @@ -2673,7 +2698,9 @@ paths:
\ is uploaded!<br/>\" + oReq.response;\n } else {\n oOutput.innerHTML\
\ = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br\
\ \\/>\";\n }\n };\n }, false);\t\n</script>\n```\n\n\n### Dealing\
\ with large files\n\nWe have created a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a>\
\ with large files\n\nYou can upload large files on api.video with <a href='https://docs.api.video/reference/post_videos-videoid-source'>Progressive\
\ Upload</a>. Alternatively, if you want to use regular upload, we have created\
\ a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a>\
\ to walk through the steps required."
operationId: POST_upload
parameters:
Expand Down Expand Up @@ -5503,7 +5530,7 @@ paths:
/players:
get:
description: |-
Retrieve a list of all the players you created, as well as details about each one.
Retrieve a list of all the player themes you created, as well as details about each one.
Tutorials that use the [player endpoint](https://api.video/blog/endpoints/player).
operationId: GET_players
parameters:
Expand All @@ -5516,6 +5543,7 @@ paths:
required: false
schema:
enum:
- name
- createdAt
- updatedAt
type: string
Expand Down Expand Up @@ -5641,7 +5669,7 @@ paths:
description: Bad Request
security:
- bearerAuth: []
summary: List all players
summary: List all player themes
tags:
- Player Themes
x-client-action: list
Expand Down Expand Up @@ -8408,12 +8436,16 @@ components:
link: path/to/my/logo/mylogo.jpg
logo: mylogo.jpg
hideTitle: true
name: name
text: text
linkActive: linkActive
forceLoop: true
playerId: pl45KFKdlddgk654dspkze
updatedAt: 2020-01-31T10:18:47Z
properties:
name:
description: The name of the player theme
type: string
text:
description: 'RGBA color for timer text. Default: rgba(255, 255, 255, 1)'
type: string
Expand Down Expand Up @@ -8487,6 +8519,7 @@ components:
type: object
player-theme-creation-payload:
example:
name: My nice theme
assets:
logo: https://cdn.api.video/player/pl14Db6oMJRH6SRVoOwORacK/logo.png
link: https://api.video
Expand All @@ -8512,6 +8545,10 @@ components:
hideTitle: false
forceLoop: false
properties:
name:
description: Add a name for your player theme here.
maxLength: 100
type: string
text:
description: 'RGBA color for timer text. Default: rgba(255, 255, 255, 1)'
type: string
Expand Down Expand Up @@ -8570,6 +8607,10 @@ components:
type: object
player-theme-update-payload:
properties:
name:
description: Add a name for your player theme here.
maxLength: 100
type: string
text:
description: 'RGBA color for timer text. Default: rgba(255, 255, 255, 1)'
type: string
Expand Down Expand Up @@ -9615,6 +9656,7 @@ components:
link: path/to/my/logo/mylogo.jpg
logo: mylogo.jpg
hideTitle: true
name: name
text: text
linkActive: linkActive
forceLoop: true
Expand All @@ -9636,6 +9678,7 @@ components:
link: path/to/my/logo/mylogo.jpg
logo: mylogo.jpg
hideTitle: true
name: name
text: text
linkActive: linkActive
forceLoop: true
Expand Down
12 changes: 6 additions & 6 deletions api_player_themes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4447d96

Please sign in to comment.