Skip to content

Commit

Permalink
Merge branch 'main' into pbe-5522-docs-rtmp-broadcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoribc authored Sep 5, 2024
2 parents 9fe30b1 + 906552e commit f567f81
Show file tree
Hide file tree
Showing 31 changed files with 1,842 additions and 595 deletions.
16 changes: 15 additions & 1 deletion docusaurus/video/docusaurus/docs/api/_common_/async-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';
const response = await client.<async operation>();

// you need to poll this endpoint
const taskResponse = await client.getTaskStatus({id: response.task_id})
const taskResponse = await client.getTask({id: response.task_id})

console.log(taskResponse.status === 'completed');
```
Expand Down Expand Up @@ -45,5 +45,19 @@ curl -X GET https://video.stream-io-api.com/api/v2/tasks/${TASK_ID}?api_key=${AP
-H "stream-auth-type: jwt"
```

</TabItem>
<TabItem value="js-deprecated" label="[email protected] (deprecated)">

```js
// Example of monitoring the status of an async task
// The logic is same for all async tasks
const response = await client.<async operation>();

// you need to poll this endpoint
const taskResponse = await client.getTaskStatus({id: response.task_id})

console.log(taskResponse.status === 'completed');
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ call.stopHLSBroadcasting();
call.start_hls_broadcasting()

# to end broadcasting
call.start_hls_broadcasting()
call.stop_hls_broadcasting()
```

</TabItem>
Expand Down
15 changes: 14 additions & 1 deletion docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TabItem from '@theme/TabItem';

```js
// send a custom event to all users watching the call
call.sendCustomEvent({
call.sendCallEvent({
custom: {
'render-animation': 'balloons',
},
Expand Down Expand Up @@ -36,5 +36,18 @@ curl -X POST https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CA
}'
```

</TabItem>
<TabItem value="js-deprecated" label="[email protected] (deprecated)">

```js
// send a custom event to all users watching the call
call.sendCustomEvent({
custom: {
'render-animation': 'balloons',
},
user_id: 'john',
});
```

</TabItem>
</Tabs>
32 changes: 24 additions & 8 deletions docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ const resp = await call.get();

// userId of existing user
const userId = 'jane';
await client.upsertUsers({
users: {
[userId]: {
id: userId,
},
},
});
const token = client.createToken(userId);
await client.upsertUsers([{ id: userId }]);
const token = client.generateUserToken({ user_id: userId });
const rtmpURL = resp.call.ingress.rtmp.address;
const streamKey = token;

Expand Down Expand Up @@ -57,5 +51,27 @@ curl -X GET "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL
# Stream key: create a user token
```

</TabItem>
<TabItem value="js-deprecated" label="[email protected] (deprecated)">

```js
const resp = await call.get();

// userId of existing user
const userId = 'jane';
await client.upsertUsers({
users: {
[userId]: {
id: userId,
},
},
});
const token = client.createToken(userId);
const rtmpURL = resp.call.ingress.rtmp.address;
const streamKey = token;

console.log(rtmpURL, streamKey);
```

</TabItem>
</Tabs>
Loading

0 comments on commit f567f81

Please sign in to comment.