File tree Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Expand file tree Collapse file tree 4 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,7 @@ export class StreamingClient {
273273 case SignalMessageAction . WARNING :
274274 const message = signalMessage . payload as string ;
275275 console . warn ( 'Warning received from server: ' + message ) ;
276+ this . publicEventEmitter . emit ( AnamEvent . SERVER_WARNING , message ) ;
276277 break ;
277278 case SignalMessageAction . TALK_STREAM_INTERRUPTED :
278279 const chatMessage =
@@ -282,9 +283,13 @@ export class StreamingClient {
282283 chatMessage . correlationId ,
283284 ) ;
284285 break ;
286+ case SignalMessageAction . SESSION_READY :
287+ const sessionId = signalMessage . sessionId as string ;
288+ this . publicEventEmitter . emit ( AnamEvent . SESSION_READY , sessionId ) ;
289+ break ;
285290 default :
286291 console . error (
287- 'StreamingClient - onSignalMessage: unknown signal message action type' ,
292+ 'StreamingClient - onSignalMessage: unknown signal message action type. Is your anam-sdk version up to date? ' ,
288293 signalMessage ,
289294 ) ;
290295 }
Original file line number Diff line number Diff line change @@ -8,4 +8,6 @@ export enum AnamEvent {
88 VIDEO_PLAY_STARTED = 'VIDEO_PLAY_STARTED' ,
99 AUDIO_STREAM_STARTED = 'AUDIO_STREAM_STARTED' ,
1010 TALK_STREAM_INTERRUPTED = 'TALK_STREAM_INTERRUPTED' ,
11+ SESSION_READY = 'SESSION_READY' ,
12+ SERVER_WARNING = 'SERVER_WARNING' ,
1113}
Original file line number Diff line number Diff line change @@ -12,4 +12,6 @@ export type EventCallbacks = {
1212 [ AnamEvent . VIDEO_PLAY_STARTED ] : ( ) => void ;
1313 [ AnamEvent . AUDIO_STREAM_STARTED ] : ( audioStream : MediaStream ) => void ;
1414 [ AnamEvent . TALK_STREAM_INTERRUPTED ] : ( correlationId : string ) => void ;
15+ [ AnamEvent . SESSION_READY ] : ( sessionId : string ) => void ;
16+ [ AnamEvent . SERVER_WARNING ] : ( message : string ) => void ;
1517} ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export enum SignalMessageAction {
77 WARNING = 'warning' ,
88 TALK_STREAM_INTERRUPTED = 'talkinputstreaminterrupted' ,
99 TALK_STREAM_INPUT = 'talkstream' ,
10+ SESSION_READY = 'sessionready' ,
1011}
1112
1213export interface SignalMessage {
You can’t perform that action at this time.
0 commit comments