mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Subscribed to STT only for camera type
parent
8925d09bd6
commit
d68326a374
|
@ -299,10 +299,14 @@ export class SessionComponent implements OnInit {
|
||||||
const subscriber: Subscriber = this.session.subscribe(event.stream, undefined);
|
const subscriber: Subscriber = this.session.subscribe(event.stream, undefined);
|
||||||
this.participantService.addRemoteConnection(connectionId, data, subscriber);
|
this.participantService.addRemoteConnection(connectionId, data, subscriber);
|
||||||
// this.oVSessionService.sendNicknameSignal(event.stream.connection);
|
// this.oVSessionService.sendNicknameSignal(event.stream.connection);
|
||||||
try {
|
|
||||||
await this.session.subscribeToSpeechToText(event.stream, this.captionService.getLangSelected().ISO);
|
if (this.participantService.getTypeConnectionData(data) === VideoType.CAMERA) {
|
||||||
} catch (error) {
|
// Only subscribe to STT when stream is CAMERA type and it is a remote stream
|
||||||
this.log.e('Error subscribing from STT: ', error);
|
try {
|
||||||
|
await this.session.subscribeToSpeechToText(event.stream, this.captionService.getLangSelected().ISO);
|
||||||
|
} catch (error) {
|
||||||
|
this.log.e('Error subscribing from STT: ', error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||||
import { Publisher, Subscriber } from 'openvidu-browser';
|
import { Publisher, Subscriber } from 'openvidu-browser';
|
||||||
import { BehaviorSubject, Observable } from 'rxjs';
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
import { ILogger } from '../../models/logger.model';
|
import { ILogger } from '../../models/logger.model';
|
||||||
import { StreamModel, ParticipantAbstractModel, ParticipantModel, ParticipantProperties } from '../../models/participant.model';
|
import { ParticipantAbstractModel, ParticipantModel, ParticipantProperties, StreamModel } from '../../models/participant.model';
|
||||||
import { VideoType } from '../../models/video-type.model';
|
import { VideoType } from '../../models/video-type.model';
|
||||||
import { OpenViduAngularConfigService } from '../config/openvidu-angular.config.service';
|
import { OpenViduAngularConfigService } from '../config/openvidu-angular.config.service';
|
||||||
import { LoggerService } from '../logger/logger.service';
|
import { LoggerService } from '../logger/logger.service';
|
||||||
|
@ -399,7 +399,12 @@ export class ParticipantService {
|
||||||
this._remoteParticipants.next([...this.remoteParticipants]);
|
this._remoteParticipants.next([...this.remoteParticipants]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getTypeConnectionData(data: string): VideoType {
|
/**
|
||||||
|
* @internal
|
||||||
|
* @param data
|
||||||
|
* @returns Stream video type
|
||||||
|
*/
|
||||||
|
getTypeConnectionData(data: string): VideoType {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(data).type;
|
return JSON.parse(data).type;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in New Issue