File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
packages/client/docusaurus/docs/javascript/02-guides
sample-apps/client/ts-quickstart/src Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ call.state.closedCaptions$.subscribe((captions) =>
55
55
updateDisplayedCaptions (captions ),
56
56
);
57
57
58
- const updateDisplayedCaptions(captions: CallClosedCaption []) {
58
+ const updateDisplayedCaptions(captions: StreamCallClosedCaption []) {
59
59
const innerHTML = captions
60
60
.map ((caption ) => ` <b>${caption .speaker_name }:</b> ${caption .text } ` )
61
61
.join (' <br>' );
Original file line number Diff line number Diff line change 1
- import { Call , CallClosedCaption } from '@stream-io/video-client' ;
1
+ import { Call , StreamCallClosedCaption } from '@stream-io/video-client' ;
2
2
3
3
export class ClosedCaptionManager {
4
4
status : 'on' | 'off' = 'off' ;
@@ -53,7 +53,7 @@ export class ClosedCaptionManager {
53
53
this . unsubscribe ?.( ) ;
54
54
}
55
55
56
- private updateDisplayedCaptions ( captions : CallClosedCaption [ ] ) {
56
+ private updateDisplayedCaptions ( captions : StreamCallClosedCaption [ ] ) {
57
57
if ( ! this . captionContainer ) {
58
58
console . warn (
59
59
'Render caption container before turning on closed captions' ,
@@ -62,13 +62,7 @@ export class ClosedCaptionManager {
62
62
}
63
63
64
64
this . captionContainer . innerHTML = captions
65
- . map ( ( caption ) => {
66
- const speaker = this . call . state . participants . find (
67
- ( p ) => p . userId === caption . speaker_id ,
68
- ) ;
69
- const speakerName = speaker ?. name || speaker ?. userId ;
70
- return `<b>${ speakerName } :</b> ${ caption . text } ` ;
71
- } )
65
+ . map ( ( caption ) => `<b>${ caption . speaker_name } :</b> ${ caption . text } ` )
72
66
. join ( '<br>' ) ;
73
67
}
74
68
}
You can’t perform that action at this time.
0 commit comments