mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: resubscribe to STT only if streamManager exists
parent
d68326a374
commit
48f20ec64f
|
@ -329,11 +329,14 @@ export class SessionComponent implements OnInit {
|
||||||
// Unsubscribe all streams from speech to text and re-subscribe with new language
|
// Unsubscribe all streams from speech to text and re-subscribe with new language
|
||||||
this.log.d('Re-subscribe from STT because of language changed to ', lang.ISO);
|
this.log.d('Re-subscribe from STT because of language changed to ', lang.ISO);
|
||||||
for (const participant of this.participantService.getRemoteParticipants()) {
|
for (const participant of this.participantService.getRemoteParticipants()) {
|
||||||
try {
|
const streamManager = participant.getCameraConnection()?.streamManager;
|
||||||
await this.session.unsubscribeFromSpeechToText(participant.getCameraConnection().streamManager.stream);
|
if (!!streamManager?.stream) {
|
||||||
await this.session.subscribeToSpeechToText(participant.getCameraConnection().streamManager.stream, lang.ISO);
|
try {
|
||||||
} catch (error) {
|
await this.session.unsubscribeFromSpeechToText(streamManager.stream);
|
||||||
this.log.e('Error re-subscribing to STT: ', error);
|
await this.session.subscribeToSpeechToText(streamManager.stream, lang.ISO);
|
||||||
|
} catch (error) {
|
||||||
|
this.log.e('Error re-subscribing to STT: ', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue