Skip to content

Commit

Permalink
Merge branch 'main' into livestream
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Oct 25, 2023
2 parents 067055f + 9765a6c commit 98ea02a
Show file tree
Hide file tree
Showing 15 changed files with 3,062 additions and 4,107 deletions.
57 changes: 55 additions & 2 deletions docusaurus/video/docusaurus/docs/api/basics/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,64 @@ import TabItem from '@theme/TabItem';

## Creating users

// TODO API endpoint
<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
const newUser: UserObjectRequest = {
id: 'userid',
role: "user",
custom: {
color: 'red'
},
name: 'This is a test user',
image: 'link/to/profile/image'
};
await client.upsertUsers({
users: {
[newUser.id]: newUser,
},
});
```

</TabItem>
</Tabs>

## Updating users

// TODO API endpoint
<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
const user: UserObjectRequest = {
id: 'userid',
role: "user",
custom: {
color: 'red'
},
name: 'This is a test user',
image: 'link/to/profile/image'
};
client.upsertUsers({
users: {
[user.id]: user,
},
});

// or
client.updateUsersPartial({users: [
{
id: user.id,
set: {
color: 'blue'
},
unset: ['name'],
}
]});
```

</TabItem>
</Tabs>

## User tokens

Expand Down
12 changes: 6 additions & 6 deletions docusaurus/video/docusaurus/docs/api/basics/calls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import TabItem from '@theme/TabItem';
```js
const callType = 'default';
const callId = 'my-first-call';
const call = client.call(callType, callId);
const call = client.video.call(callType, callId);

call.create({ data: { created_by_id: 'john' } });
// or
Expand Down Expand Up @@ -117,7 +117,7 @@ curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}?api_
<TabItem value="js" label="JavaScript">

```js
call.update({ settings_override: { audio: { mic_default_on: true } } });
call.update({ settings_override: { audio: { mic_default_on: true, default_device: "speaker" } } });

// or to update custom data
call.update({ custom: { color: 'red' } });
Expand Down Expand Up @@ -317,23 +317,23 @@ curl -X PUT "https://video.stream-io-api.com/video/call/default/${CALL_ID}/membe

```js
// default sorting
client.queryCalls();
client.video.queryCalls();

// sorting and pagination
const queryCallsReq = {
sort: [{ field: 'starts_at', direction: -1 }],
limit: 2,
};
response = await client.queryCalls(queryCallsReq);
response = await client.video.queryCalls(queryCallsReq);

// loading next page
client.queryCalls({
client.video.queryCalls({
...queryCallsReq,
next: response.next,
});

// filtering
client.queryCalls({
client.video.queryCalls({
filter_conditions: { backstage: { $eq: false } },
});
```
Expand Down
23 changes: 10 additions & 13 deletions docusaurus/video/docusaurus/docs/api/basics/get_started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import RTMP from '../_common_/rtmp.mdx'
<TabItem value="js" label="JavaScript">

```bash
npm install @stream-io/video-client
npm install @stream-io/node-sdk
// or using yarn
yarn add @stream-io/video-client
yarn add @stream-io/node-sdk
```

</TabItem>
Expand All @@ -43,9 +43,9 @@ go get github.com/GetStream/video-go-sdk
<TabItem value="js" label="JavaScript">

```js
const client = new StreamVideoServerClient('<Your API key>', {
secret: '<API secret>',
});
const apiKey = '';
const secret = '';
client = new StreamClient(apiKey, secret);
```

</TabItem>
Expand Down Expand Up @@ -136,7 +136,7 @@ func main() {
```js
const callType = 'default';
const callId = 'my-first-call';
const call = client.call(callType, callId);
const call = client.video.call(callType, callId);

call.create({ data: { created_by_id: 'john' } });

Expand Down Expand Up @@ -303,7 +303,7 @@ curl -X PUT "https://video.stream-io-api.com/video/call/default/${CALL_ID}/membe
<TabItem value="js" label="JavaScript">

```js
call.update({ settings_override: { audio: { mic_default_on: true } } });
call.update({ settings_override: { audio: { mic_default_on: true, default_device: "speaker" } } });

// or to update custom data
call.update({ custom: { color: 'red' } });
Expand Down Expand Up @@ -400,10 +400,10 @@ curl -X PUT "https://video.stream-io-api.com/video/call/default/${CALL_ID}?api_k
<TabItem value="js" label="JavaScript">

```js
call.startBroadcasting();
call.startHLSBroadcasting();

// to end broadcasting
call.stopBroadcasting();
call.stopHLSBroadcasting();
```

</TabItem>
Expand Down Expand Up @@ -556,10 +556,7 @@ curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/star
<TabItem value="js" label="JavaScript">

```js
call.queryRecordings();

// optionally query recordings for a specific session
call.queryRecordings('<session ID>');
call.listRecordings();
```

</TabItem>
Expand Down
32 changes: 32 additions & 0 deletions docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,35 @@ sidebar_position: 3
slug: /call_types/geofencing
title: Geofencing
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.createCallType({
name: '<call type name>',
settings: {
geofencing: {
names: ['european_union'],
},
},
});

//override settings on call level
call.create({
data: {
created_by_id: 'john',
settings_override: {
geofencing: {
names: ['european_union'],
},
},
},
});
```

</TabItem>
</Tabs>
77 changes: 77 additions & 0 deletions docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
id: manage_types
sidebar_position: 2
slug: /call_types/manage
title: Manage Types
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Read call types

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.listCallTypes();

//or
client.getCallType({name: 'livestream'});
```

</TabItem>
</Tabs>

## Create call type

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.createCallType({
name: 'allhands',
settings: {
audio: { mic_default_on: true, default_device: 'speaker' },
},
grants: {
admin: [
VideoOwnCapability.SEND_AUDIO,
VideoOwnCapability.SEND_VIDEO,
VideoOwnCapability.MUTE_USERS,
],
user: [VideoOwnCapability.SEND_AUDIO, VideoOwnCapability.SEND_VIDEO],
},
});
```

</TabItem>
</Tabs>

## Update call type

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.updateCallType('allhands', {
settings: {
audio: { mic_default_on: false, default_device: 'earpiece' },
},
});
```

</TabItem>
</Tabs>

## Delete call type

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.deleteCallType({name: 'allhands'});
```

</TabItem>
</Tabs>
25 changes: 24 additions & 1 deletion docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
---
id: call_types_permissions
sidebar_position: 2
sidebar_position: 3
slug: /call_types/permissions
title: Permissions
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.createCallType({
name: '<call type name>',
grants: {
admin: [
VideoOwnCapability.SEND_AUDIO,
VideoOwnCapability.SEND_VIDEO,
VideoOwnCapability.MUTE_USERS,
],
user: [VideoOwnCapability.SEND_AUDIO, VideoOwnCapability.SEND_VIDEO],
},
});
```

</TabItem>
</Tabs>
63 changes: 62 additions & 1 deletion docusaurus/video/docusaurus/docs/api/call_types/settings.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,67 @@
---
id: call_types_settings
sidebar_position: 4
sidebar_position: 5
slug: /call_types/settings
title: Settings
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

## Settings

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.createCallType({
name: '<call type name>',
settings: {
screensharing: {
access_request_enabled: false,
enabled: true,
},
},
});

// override settings on call level
call.create({
data: {
created_by_id: 'john',
settings_override: {
screensharing: {
enabled: false,
},
},
},
});
```

</TabItem>
</Tabs>

## Notification settings

<Tabs groupId="examples">
<TabItem value="js" label="JavaScript">

```js
client.video.createCallType({
name: '<call type name>',
notification_settings: {
enabled: true,
call_notification: {
apns: {
title: '{{ user.display_name }} invites you to a call',
},
enabled: true,
},
session_started: {
enabled: false,
},
},
});
```

</TabItem>
</Tabs>
Loading

0 comments on commit 98ea02a

Please sign in to comment.