Skip to content

Commit

Permalink
Livestream creation doc
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierapivideo committed Mar 28, 2022
1 parent cfcf4da commit 64177bc
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 65 deletions.
10 changes: 5 additions & 5 deletions doc/api/CaptionsApi.md
Expand Up @@ -37,7 +37,7 @@ Promise<[**void**](../model/.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklgc'; // The unique identifier for the video you want to delete a caption from.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
Expand Down Expand Up @@ -89,7 +89,7 @@ Promise<[**CaptionsListResponse**](../model/CaptionsListResponse.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want captions for.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
Expand Down Expand Up @@ -141,7 +141,7 @@ Promise<[**Caption**](../model/Caption.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want captions for.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation
Expand Down Expand Up @@ -193,7 +193,7 @@ Promise<[**Caption**](../model/Caption.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to have automatic captions for.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
Expand Down Expand Up @@ -250,7 +250,7 @@ Promise<[**Caption**](../model/Caption.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to add a caption to.
const language = 'en'; // A valid BCP 47 language representation.
Expand Down
8 changes: 4 additions & 4 deletions doc/api/ChaptersApi.md
Expand Up @@ -34,7 +34,7 @@ Promise<[**void**](../model/.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want to delete a chapter from.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
Expand Down Expand Up @@ -86,7 +86,7 @@ Promise<[**ChaptersListResponse**](../model/ChaptersListResponse.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want to show a chapter for.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
Expand Down Expand Up @@ -137,7 +137,7 @@ Promise<[**Chapter**](../model/Chapter.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want to show a chapter for.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
Expand Down Expand Up @@ -189,7 +189,7 @@ Promise<[**Chapter**](../model/Chapter.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want to upload a chapter for.
const language = 'en'; // A valid [BCP 47](https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers) language representation.
Expand Down
40 changes: 15 additions & 25 deletions doc/api/LiveStreamsApi.md
Expand Up @@ -36,7 +36,7 @@ Promise<[**void**](../model/.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream that you want to remove.

Expand Down Expand Up @@ -84,7 +84,7 @@ Promise<[**LiveStream**](../model/LiveStream.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique identifier for the live stream you want to delete.

Expand Down Expand Up @@ -138,7 +138,7 @@ Promise<[**LiveStreamListResponse**](../model/LiveStreamListResponse.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const streamKey = '30087931-229e-42cf-b5f9-e91bcc1f7332'; // The unique stream key that allows you to stream videos.
const name = 'My Video'; // You can filter live streams by their name or a part of their name.
Expand Down Expand Up @@ -191,7 +191,7 @@ Promise<[**LiveStream**](../model/LiveStream.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream you want to watch.

Expand Down Expand Up @@ -240,7 +240,7 @@ Promise<[**LiveStream**](../model/LiveStream.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'li400mYKSgQ6xs7taUeSaEKr'; // The unique ID for the live stream that you want to update information for such as player details, or whether you want the recording on or off.
const liveStreamUpdatePayload = {
Expand Down Expand Up @@ -291,27 +291,17 @@ Promise<[**LiveStream**](../model/LiveStream.md)>.

### Example
```js
//install the module with npm or yarn
//npm install @api.video/nodejs-client --save
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamCreationPayload = {
name: "My Live Stream Video", // Add a name for your live stream here.
record: true, // Whether you are recording or not. True for record, false for not record.
_public: true, // BETA FEATURE Please limit all public = false ("private") livestreams to 3,000 users. Whether your video can be viewed by everyone, or requires authentication to see it. A setting of false will require a unique token for each view.
playerId: "pl4f4ferf5erfr5zed4fsdd", // The unique identifier for the player.
};
const liveStreamCreationPayload = {
record: false, // Whether you are recording or not. True for record, false for not record.
name: "My Live Stream", // Add a name for your live stream here.
_public: true, // Whether your video can be viewed by everyone, or requires authentication to see it.
playerId: "pl4f4ferf5erfr5zed4fsdd", // The unique identifier for the player.
};

// LiveStream
const result = await client.liveStreams.create(liveStreamCreationPayload);
console.log(result);
} catch (e) {
console.error(e);
}
})();
const liveStream = await client.liveStreams.create(liveStreamCreationPayload);
```


Expand Down Expand Up @@ -351,7 +341,7 @@ Promise<[**LiveStream**](../model/LiveStream.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique ID for the live stream you want to upload.
const file = 'BINARY_DATA_HERE'; // The image to be added as a thumbnail.
Expand Down
14 changes: 7 additions & 7 deletions doc/api/PlayerThemesApi.md
Expand Up @@ -38,7 +38,7 @@ Promise<[**void**](../model/.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const playerId = 'pl45d5vFFGrfdsdsd156dGhh'; // The unique identifier for the player you want to delete.

Expand Down Expand Up @@ -85,7 +85,7 @@ Promise<[**void**](../model/.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const playerId = 'pl14Db6oMJRH6SRVoOwORacK'; // The unique identifier for the player.

Expand Down Expand Up @@ -138,7 +138,7 @@ Promise<[**PlayerThemesListResponse**](../model/PlayerThemesListResponse.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const sortBy = 'createdAt'; // createdAt is the time the player was created. updatedAt is the time the player was last updated. The time is presented in ISO-8601 format.
const sortOrder = 'asc'; // Allowed: asc, desc. Ascending for date and time means that earlier values precede later ones. Descending means that later values preced earlier ones.
Expand Down Expand Up @@ -190,7 +190,7 @@ Promise<[**PlayerTheme**](../model/PlayerTheme.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const playerId = 'pl45d5vFFGrfdsdsd156dGhh'; // The unique identifier for the player you want to retrieve.

Expand Down Expand Up @@ -240,7 +240,7 @@ Promise<[**PlayerTheme**](../model/PlayerTheme.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const playerId = 'pl45d5vFFGrfdsdsd156dGhh'; // The unique identifier for the player.
const playerThemeUpdatePayload = {
Expand Down Expand Up @@ -305,7 +305,7 @@ Promise<[**PlayerTheme**](../model/PlayerTheme.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const playerThemeCreationPayload = {
text: "text_example", // RGBA color for timer text. Default: rgba(255, 255, 255, 1)
Expand Down Expand Up @@ -370,7 +370,7 @@ Promise<[**PlayerTheme**](../model/PlayerTheme.md)>.
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const playerId = 'pl14Db6oMJRH6SRVoOwORacK'; // The unique identifier for the player.
const file = 'BINARY_DATA_HERE'; // The name of the file you want to use for your logo.
Expand Down
6 changes: 3 additions & 3 deletions doc/api/RawStatisticsApi.md
Expand Up @@ -35,7 +35,7 @@ Promise<[**RawStatisticsListLiveStreamAnalyticsResponse**](../model/RawStatistic
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const liveStreamId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the live stream you want to retrieve analytics for.
const period = '2019-01-01'; // Period must have one of the following formats: - For a day : "2018-01-01", - For a week: "2018-W01", - For a month: "2018-01" - For a year: "2018" For a range period: - Date range: "2018-01-01/2018-01-15"
Expand Down Expand Up @@ -89,7 +89,7 @@ Promise<[**RawStatisticsListPlayerSessionEventsResponse**](../model/RawStatistic
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const sessionId = 'psEmFwGQUAXR2lFHj5nDOpy'; // A unique identifier you can use to reference and track a session with.
const currentPage = '2'; // Choose the number of search results to return per page. Minimum value: 1
Expand Down Expand Up @@ -144,7 +144,7 @@ Promise<[**RawStatisticsListSessionsResponse**](../model/RawStatisticsListSessio
//yarn add @api.video/nodejs-client
(async () => {
try {
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Prklg'; // The unique identifier for the video you want to retrieve session information for.
const period = 'period_example'; // Period must have one of the following formats: - For a day : 2018-01-01, - For a week: 2018-W01, - For a month: 2018-01 - For a year: 2018 For a range period: - Date range: 2018-01-01/2018-01-15
Expand Down
8 changes: 4 additions & 4 deletions doc/api/UploadTokensApi.md
Expand Up @@ -31,7 +31,7 @@ Promise<[**void**](../model/.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const uploadToken = 'to1tcmSFHeYY5KzyhOqVKMKb'; // The unique identifier for the upload token you want to delete. Deleting a token will make it so the token can no longer be used for authentication.

Expand Down Expand Up @@ -74,7 +74,7 @@ Promise<[**TokenListResponse**](../model/TokenListResponse.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const uploadTokens = await client.uploadTokens.list();

Expand Down Expand Up @@ -111,7 +111,7 @@ Promise<[**UploadToken**](../model/UploadToken.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const uploadTokenId = 'to1tcmSFHeYY5KzyhOqVKMKb'; // The unique identifier for the token you want information about.

Expand Down Expand Up @@ -150,7 +150,7 @@ Promise<[**UploadToken**](../model/UploadToken.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const tokenCreationPayload = {
ttl: 56, // Time in seconds that the token will be active. A value of 0 means that the token has no expiration date. The default is to have no expiration.
Expand Down
20 changes: 10 additions & 10 deletions doc/api/VideosApi.md
Expand Up @@ -37,7 +37,7 @@ Promise<[**void**](../model/.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // the id of the video to delete
await client.videos.delete(videoId);
Expand Down Expand Up @@ -75,7 +75,7 @@ Promise<[**Video**](../model/Video.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want the status for.
const result = await client.videos.getStatus(videoId);
Expand Down Expand Up @@ -113,7 +113,7 @@ Promise<[**VideoStatus**](../model/VideoStatus.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The unique identifier for the video you want the status for.
const result = await client.videos.getStatus(videoId);
Expand Down Expand Up @@ -159,7 +159,7 @@ Promise<[**VideosListResponse**](../model/VideosListResponse.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

// list all videos (all pages)
let allVideos = [];
Expand Down Expand Up @@ -214,7 +214,7 @@ Promise<[**Video**](../model/Video.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // The video ID for the video you want to update.

Expand Down Expand Up @@ -273,7 +273,7 @@ Promise<[**Video**](../model/Video.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // Unique identifier of the video you want to add a thumbnail to, where you use a section of your video as the thumbnail.
const videoThumbnailPickPayload = {
Expand Down Expand Up @@ -319,7 +319,7 @@ Promise<[**Video**](../model/Video.md)>.
// The following example show how to do it from the backend, but you should rather use the standard upload method in this case.

// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const token = 'to4k0jvEUuaTdRAEjQ4Jfrgz'; // Enter the unique identifier for the token you want to use to upload a video.
const file = './my-video.mp4'; // 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.
Expand Down Expand Up @@ -396,7 +396,7 @@ Promise<[**Video**](../model/Video.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

// create a simple video
const video = await client.videos.create({ title: "Maths video" });
Expand Down Expand Up @@ -470,7 +470,7 @@ Promise<[**Video**](../model/Video.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'vi4k0jvEUuaTdRAEjQ4Jfrgz'; // Enter the videoId you want to use to upload your video.
const file = './my-video.mp4'; // 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.
Expand Down Expand Up @@ -557,7 +557,7 @@ Promise<[**Video**](../model/Video.md)>.
### Example
```js
// instantiate the client
const client = new ApiVideoClient({ apiKey: "YOUR_API_TOKEN" });
const client = new ApiVideoClient({ apiKey: "YOUR_API_KEY" });

const videoId = 'videoId_example'; // Unique identifier of the chosen video
const file = './thumbnail.jpg'; // The image to be added as a thumbnail.
Expand Down

0 comments on commit 64177bc

Please sign in to comment.