File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/client/docusaurus/docs/javascript/02-guides
sample-apps/client/ts-quickstart/src Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,15 @@ call.state.captioning$.subscribe((isCaptioningInProgress) => {
72
72
You can access the most recent captions using the call state:
73
73
74
74
``` typescript
75
- import { StreamCallClosedCaption } from ' @stream-io/video-client' ;
75
+ import { CallClosedCaption } from ' @stream-io/video-client' ;
76
76
77
77
const subscription = call .state .closedCaptions$ .subscribe ((captions ) =>
78
78
updateDisplayedCaptions (captions ),
79
79
);
80
80
81
- const updateDisplayedCaptions = (captions : StreamCallClosedCaption []) => {
81
+ const updateDisplayedCaptions = (captions : CallClosedCaption []) => {
82
82
const innerHTML = captions
83
- .map ((caption ) => ` <b>${caption .speaker_name }:</b> ${caption .text } ` )
83
+ .map ((caption ) => ` <b>${caption .user . name }:</b> ${caption .text } ` )
84
84
.join (' <br>' );
85
85
};
86
86
Original file line number Diff line number Diff line change 1
- import { Call , StreamCallClosedCaption } from '@stream-io/video-client' ;
1
+ import { Call , CallClosedCaption } from '@stream-io/video-client' ;
2
2
3
3
export class ClosedCaptionManager {
4
4
status : 'on' | 'off' = 'off' ;
@@ -49,7 +49,7 @@ export class ClosedCaptionManager {
49
49
this . unsubscribe ?.( ) ;
50
50
}
51
51
52
- private updateDisplayedCaptions ( captions : StreamCallClosedCaption [ ] ) {
52
+ private updateDisplayedCaptions ( captions : CallClosedCaption [ ] ) {
53
53
if ( ! this . captionContainer ) {
54
54
console . warn (
55
55
'Render caption container before turning on closed captions' ,
@@ -58,7 +58,7 @@ export class ClosedCaptionManager {
58
58
}
59
59
60
60
this . captionContainer . innerHTML = captions
61
- . map ( ( caption ) => `<b>${ caption . speaker_name } :</b> ${ caption . text } ` )
61
+ . map ( ( caption ) => `<b>${ caption . user . name } :</b> ${ caption . text } ` )
62
62
. join ( '<br>' ) ;
63
63
}
64
64
}
You can’t perform that action at this time.
0 commit comments