Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 29.5.0

* Added: `videos` service to create, list, get, update and delete videos from files in Storage
* Added: `videos.listRenditions`, `getRendition` and `deleteRendition`; renditions are created from a server SDK or the Console
* Added: `videos.createCaption`, `listCaptions`, `updateCaption` and `deleteCaption` for subtitle tracks
* Added: `getHlsManifest`, `getDashManifest`, `getCmafHlsManifest`, `getCmafDashManifest`, `getCaptionManifest`, `getThumbnail` and `getTimeline` playback URLs, and `listCodecs`
* Added: `Video`, `VideoCodec`, `VideoRendition` and `VideoCaption` models, their list models, and the `VideoCodecId`, `VideoOutput`, `VideoRenditionStatus`, `VideoCaptionStatus` and `VideoTimelineStatus` enums

## 29.4.0

* Added: Atlassian, Instagram, LINE, Linear, Netlify, Patreon, Railway, Reddit, Roblox, Strava, Vercel, VK and WorkOS to `OAuthProvider`
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import { Client, Account } from 'appwrite';

### CDN

Every release is published to `https://sdk.appwrite.io/web/29.4.0/`.
Every release is published to `https://sdk.appwrite.io/web/29.5.0/`.

#### ES modules

Each service, helper and enum is its own module, so the browser downloads only what you import. A service is served under its name in kebab case, such as `TablesDB` from `tables-db.js`, and enums under `enums/`, such as `OAuthProvider` from `enums/o-auth-provider.js`. `index.js` re-exports everything, so importing it loads every service:

```html
<script type="module">
import { Client } from 'https://sdk.appwrite.io/web/29.4.0/client.js';
import { Account } from 'https://sdk.appwrite.io/web/29.4.0/account.js';
import { OAuthProvider } from 'https://sdk.appwrite.io/web/29.4.0/enums/o-auth-provider.js';
import { Client } from 'https://sdk.appwrite.io/web/29.5.0/client.js';
import { Account } from 'https://sdk.appwrite.io/web/29.5.0/account.js';
import { OAuthProvider } from 'https://sdk.appwrite.io/web/29.5.0/enums/o-auth-provider.js';
</script>
```

Expand All @@ -46,7 +46,7 @@ Each service, helper and enum is its own module, so the browser downloads only w
Add the script before any code that uses the SDK. It exposes every export on the global `Appwrite` object:

```html
<script src="https://sdk.appwrite.io/web/29.4.0/sdk.min.js"></script>
<script src="https://sdk.appwrite.io/web/29.5.0/sdk.min.js"></script>
<script>
const { Client, Account } = Appwrite;
</script>
Expand All @@ -61,7 +61,7 @@ Add the script before any code that uses the SDK. It exposes every export on the
The script tag build is also available from jsDelivr:

```html
<script src="https://cdn.jsdelivr.net/npm/appwrite@29.4.0"></script>
<script src="https://cdn.jsdelivr.net/npm/appwrite@29.5.0"></script>
```

## Getting started
Expand Down
20 changes: 20 additions & 0 deletions docs/examples/videos/create-caption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.createCaption({
videoId: '<VIDEO_ID>',
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
name: '<NAME>',
language: 'aar',
xdefault: false, // optional
});

console.log(result);
```
19 changes: 19 additions & 0 deletions docs/examples/videos/create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```javascript
import { Client, Videos, Permission, Role } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.create({
videoId: '<VIDEO_ID>',
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
name: '<NAME>', // optional
permissions: [Permission.read(Role.any())], // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/videos/delete-caption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.deleteCaption({
videoId: '<VIDEO_ID>',
captionId: '<CAPTION_ID>',
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/videos/delete-rendition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.deleteRendition({
videoId: '<VIDEO_ID>',
renditionId: '<RENDITION_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.delete({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/videos/get-caption-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Videos, VideoOutput } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getCaptionManifest({
videoId: '<VIDEO_ID>',
output: VideoOutput.Hls,
captionId: '<CAPTION_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/get-cmaf-dash-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getCmafDashManifest({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/get-cmaf-hls-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getCmafHlsManifest({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/get-dash-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getDashManifest({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/get-hls-manifest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getHlsManifest({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/videos/get-rendition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.getRendition({
videoId: '<VIDEO_ID>',
renditionId: '<RENDITION_ID>',
});

console.log(result);
```
19 changes: 19 additions & 0 deletions docs/examples/videos/get-thumbnail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```javascript
import { Client, Videos, ImageFormat } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getThumbnail({
videoId: '<VIDEO_ID>',
thumbnailId: '<THUMBNAIL_ID>',
width: 0, // optional
height: 0, // optional
output: ImageFormat.Jpg, // optional
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/get-timeline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = videos.getTimeline({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
15 changes: 15 additions & 0 deletions docs/examples/videos/get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.get({
videoId: '<VIDEO_ID>',
});

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/videos/list-captions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.listCaptions({
videoId: '<VIDEO_ID>',
queries: [], // optional
total: false, // optional
});

console.log(result);
```
13 changes: 13 additions & 0 deletions docs/examples/videos/list-codecs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.listCodecs();

console.log(result);
```
17 changes: 17 additions & 0 deletions docs/examples/videos/list-renditions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.listRenditions({
videoId: '<VIDEO_ID>',
queries: [], // optional
total: false, // optional
});

console.log(result);
```
16 changes: 16 additions & 0 deletions docs/examples/videos/list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.list({
queries: [], // optional
total: false, // optional
});

console.log(result);
```
21 changes: 21 additions & 0 deletions docs/examples/videos/update-caption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```javascript
import { Client, Videos } from 'appwrite';

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

const videos = new Videos(client);

const result = await videos.updateCaption({
videoId: '<VIDEO_ID>',
captionId: '<CAPTION_ID>',
bucketId: '<BUCKET_ID>', // optional
fileId: '<FILE_ID>', // optional
name: '<NAME>', // optional
language: 'aar', // optional
xdefault: false, // optional
});

console.log(result);
```
Loading