Skip to content

Commit

Permalink
Merge pull request #32 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 596ad23 + 2b188a8 commit bca7982
Show file tree
Hide file tree
Showing 13 changed files with 122 additions and 10 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.1.0] - 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 @@ -192,7 +192,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**delete**](docs/Api/PlayerThemesApi.md#delete) | **DELETE** `/players/{playerId}` | Delete a player
[**deleteLogo**](docs/Api/PlayerThemesApi.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo
[**list**](docs/Api/PlayerThemesApi.md#list) | **GET** `/players` | List all players
[**list**](docs/Api/PlayerThemesApi.md#list) | **GET** `/players` | List all player themes
[**get**](docs/Api/PlayerThemesApi.md#get) | **GET** `/players/{playerId}` | Show a player
[**update**](docs/Api/PlayerThemesApi.md#update) | **PATCH** `/players/{playerId}` | Update a player
[**create**](docs/Api/PlayerThemesApi.md#create) | **POST** `/players` | Create a player
Expand Down
4 changes: 2 additions & 2 deletions docs/Api/PlayerThemesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**delete()**](PlayerThemesApi.md#delete) | **DELETE** `/players/{playerId}` | Delete a player
[**deleteLogo()**](PlayerThemesApi.md#deleteLogo) | **DELETE** `/players/{playerId}/logo` | Delete logo
[**list()**](PlayerThemesApi.md#list) | **GET** `/players` | List all players
[**list()**](PlayerThemesApi.md#list) | **GET** `/players` | List all player themes
[**get()**](PlayerThemesApi.md#get) | **GET** `/players/{playerId}` | Show a player
[**update()**](PlayerThemesApi.md#update) | **PATCH** `/players/{playerId}` | Update a player
[**create()**](PlayerThemesApi.md#create) | **POST** `/players` | Create a player
Expand Down Expand Up @@ -63,7 +63,7 @@ void (empty response body)
## list()


Retrieve a list of all the players you created, as well as details about each one. Tutorials that use the [player endpoint](https://api.video/blog/endpoints/player).
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).


### Arguments
Expand Down
6 changes: 3 additions & 3 deletions docs/Api/VideosApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Name | Type | Description | Example | Notes
## uploadWithUploadToken()


When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=<tokenId>`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F [email protected] ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html <!--form for user interaction--> <form name=\"videoUploadForm\" > <label for=video>Video:</label> <input type=file name=source/><br/> <input value=\"Submit\" type=\"submit\"> </form> <div></div> <!--JS takes the form data uses FormData to turn the response into JSON. then uses POST to upload the video file. Update the token parameter in the url to your upload token. --> <script> var form = document.forms.namedItem(\"videoUploadForm\"); form.addEventListener('submit', function(ev) { ev.preventDefault(); var oOutput = document.querySelector(\"div\"), oData = new FormData(form); var oReq = new XMLHttpRequest(); oReq.open(\"POST\", \"https://ws.api.video/upload?token=toXXX\", true); oReq.send(oData); oReq.onload = function(oEvent) { if (oReq.status ==201) { oOutput.innerHTML = \"Your video is uploaded!<br/>\" + oReq.response; } else { oOutput.innerHTML = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br />\"; } }; }, false); </script> ``` ### Dealing with large files We have created a <a href='https://api.video/blog/tutorials/uploading-large-files-with-javascript'>tutorial</a> to walk through the steps required.
When given a token, anyone can upload a file to the URI `https://ws.api.video/upload?token=<tokenId>`. Example with cURL: ```curl $ curl --request POST --url 'https://ws.api.video/upload?token=toXXX' --header 'content-type: multipart/form-data' -F [email protected] ``` Or in an HTML form, with a little JavaScript to convert the form into JSON: ```html <!--form for user interaction--> <form name=\"videoUploadForm\" > <label for=video>Video:</label> <input type=file name=source/><br/> <input value=\"Submit\" type=\"submit\"> </form> <div></div> <!--JS takes the form data uses FormData to turn the response into JSON. then uses POST to upload the video file. Update the token parameter in the url to your upload token. --> <script> var form = document.forms.namedItem(\"videoUploadForm\"); form.addEventListener('submit', function(ev) { ev.preventDefault(); var oOutput = document.querySelector(\"div\"), oData = new FormData(form); var oReq = new XMLHttpRequest(); oReq.open(\"POST\", \"https://ws.api.video/upload?token=toXXX\", true); oReq.send(oData); oReq.onload = function(oEvent) { if (oReq.status ==201) { oOutput.innerHTML = \"Your video is uploaded!<br/>\" + oReq.response; } else { oOutput.innerHTML = \"Error \" + oReq.status + \" occurred when trying to upload your file.<br />\"; } }; }, false); </script> ``` ### Dealing with large files You 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.


### Arguments
Expand Down Expand Up @@ -310,7 +310,7 @@ Name | Type | Description | Example | Notes
## upload()


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).
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. We offer 2 types of upload: * Regular upload * Progressive upload 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 * allow the upload of video sources > 200 MiB (200 MiB = the max. allowed file size for regular upload) * allow to send a video source \"progressively\", i.e., before before knowing the total size of the video. 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). ```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).

### Example

Expand Down Expand Up @@ -352,7 +352,7 @@ Name | Type | Description | Example | Notes
------------- | ------------- | ------------- | ------------- | -------------
`videoId` | **string**| Enter the videoId you want to use to upload your video. | `vi4k0jvEUuaTdRAEjQ4Jfrgz` |
`file` | **\SplFileObject**| The path to the video you would like to upload. The path must be local. If you want to use a video from an online source, you must use the \\\&quot;/videos\\\&quot; endpoint and add the \\\&quot;source\\\&quot; parameter when you create a new video. | `new \SplFileObject('path')` |
`contentRange` | **string**| 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 &lt;from_byte&gt;-&lt;to_byte&gt;/&lt;total_bytes&gt;: * &lt;from_byte&gt; 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. * &lt;to_byte&gt; 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. * &lt;total_bytes&gt; 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 &#x60;Content-Range&#x60; header value must match the following pattern: &#x60;part &lt;part&gt;/&lt;total_parts&gt;&#x60;: * &#x60;&lt;part&gt;&#x60; is a positive integer representing the part number. The first sequential part number is always 1. * &#x60;&lt;total_parts&gt;&#x60; is a positive integer representing the total parts of the video source. It can also be &#x60;*&#x60; if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. | `bytes 209715200-419430399/52428800 OR part 2/3` | [optional]
`contentRange` | **string**| 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 parts (recommended option), the &#x60;Content-Range&#x60; header value must match the following pattern: &#x60;part &lt;part&gt;/&lt;total_parts&gt;&#x60;: * &#x60;&lt;part&gt;&#x60; is a positive integer representing the part number. The first sequential part number is always 1. * &#x60;&lt;total_parts&gt;&#x60; is a positive integer representing the total parts of the video source. It can also be &#x60;*&#x60; 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 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: &#x60;bytes &lt;from_byte&gt;-&lt;to_byte&gt;/&lt;total_bytes&gt;&#x60;: * &#x60;&lt;from_byte&gt;&#x60; 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. * &#x60;&lt;to_byte&gt;&#x60; 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. * &#x60;&lt;total_bytes&gt;&#x60; is a positive integer representing the total bytes composing the full video source. It can also be &#x60;*&#x60; if or as long as it is unknown. Technically, this value is required only one time and cannot differ in several requests. * Ordering and chunk or part size * The order in which the chunks are received on our side does not matter. * Example: &#x60;part 3/_*&#x60; then &#x60;part 2/_*&#x60; then &#x60;part 1/3&#x60; works. * The chunks can be sent concurrently. We have a lock mechanism to ensure they are still technically processed one by one to ensure the \&quot;completion\&quot; check behaves as expected. * 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 \&quot;byte-range\&quot; system and the last part for the \&quot;part\&quot; system. * For instance, if your video is 10.5 MiB big, your last chunk would be 500 KiB, and that would work. * 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. | `bytes 209715200-419430399/524288000 OR part 2/3` | [optional]



Expand Down
1 change: 1 addition & 0 deletions docs/Model/PlayerTheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | The name of the player theme | [optional]
**text** | **string** | RGBA color for timer text. Default: rgba(255, 255, 255, 1) | [optional]
**link** | **string** | RGBA color for all controls. Default: rgba(255, 255, 255, 1) | [optional]
**linkHover** | **string** | RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/Model/PlayerThemeCreationPayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | Add a name for your player theme here. | [optional]
**text** | **string** | RGBA color for timer text. Default: rgba(255, 255, 255, 1) | [optional]
**link** | **string** | RGBA color for all controls. Default: rgba(255, 255, 255, 1) | [optional]
**linkHover** | **string** | RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/Model/PlayerThemeUpdatePayload.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | Add a name for your player theme here. | [optional]
**text** | **string** | RGBA color for timer text. Default: rgba(255, 255, 255, 1) | [optional]
**link** | **string** | RGBA color for all controls. Default: rgba(255, 255, 255, 1) | [optional]
**linkHover** | **string** | RGBA color for all controls when hovered. Default: rgba(255, 255, 255, 1) | [optional]
Expand Down
2 changes: 1 addition & 1 deletion src/Api/PlayerThemesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private function buildDeleteLogoRequest(string $playerId): Request


/**
* List all players
* List all player themes
*
* @param array $queryParams
*
Expand Down
Loading

0 comments on commit bca7982

Please sign in to comment.