Skip to content

Commit e44bfd6

Browse files
committed
fix: use correct types, update cookbook
1 parent f09d1ec commit e44bfd6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/client/docusaurus/docs/javascript/02-guides/16-closed-captions.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ call.state.captioning$.subscribe((isCaptioningInProgress) => {
7272
You can access the most recent captions using the call state:
7373

7474
```typescript
75-
import { StreamCallClosedCaption } from '@stream-io/video-client';
75+
import { CallClosedCaption } from '@stream-io/video-client';
7676

7777
const subscription = call.state.closedCaptions$.subscribe((captions) =>
7878
updateDisplayedCaptions(captions),
7979
);
8080

81-
const updateDisplayedCaptions = (captions: StreamCallClosedCaption[]) => {
81+
const updateDisplayedCaptions = (captions: CallClosedCaption[]) => {
8282
const innerHTML = captions
83-
.map((caption) => `<b>${caption.speaker_name}:</b> ${caption.text}`)
83+
.map((caption) => `<b>${caption.user.name}:</b> ${caption.text}`)
8484
.join('<br>');
8585
};
8686

sample-apps/client/ts-quickstart/src/closed-captions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Call, StreamCallClosedCaption } from '@stream-io/video-client';
1+
import { Call, CallClosedCaption } from '@stream-io/video-client';
22

33
export class ClosedCaptionManager {
44
status: 'on' | 'off' = 'off';
@@ -49,7 +49,7 @@ export class ClosedCaptionManager {
4949
this.unsubscribe?.();
5050
}
5151

52-
private updateDisplayedCaptions(captions: StreamCallClosedCaption[]) {
52+
private updateDisplayedCaptions(captions: CallClosedCaption[]) {
5353
if (!this.captionContainer) {
5454
console.warn(
5555
'Render caption container before turning on closed captions',
@@ -58,7 +58,7 @@ export class ClosedCaptionManager {
5858
}
5959

6060
this.captionContainer.innerHTML = captions
61-
.map((caption) => `<b>${caption.speaker_name}:</b> ${caption.text}`)
61+
.map((caption) => `<b>${caption.user.name}:</b> ${caption.text}`)
6262
.join('<br>');
6363
}
6464
}

0 commit comments

Comments
 (0)