-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from apivideo/add-player-theme-name
feat(all): a name property in player themes
- Loading branch information
Showing
13 changed files
with
122 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
||
|
@@ -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 \\\"/videos\\\" endpoint and add the \\\"source\\\" 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 <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. | `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 `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. * 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>`: * `<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. * Ordering and chunk or part size * The order in which the chunks are received on our side does not matter. * Example: `part 3/_*` then `part 2/_*` then `part 1/3` 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 \"completion\" 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 \"byte-range\" system and the last part for the \"part\" 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] | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.