openvidu-components: Fixed onSessionCreated event sending

Fired onSessionCreated event immediately after its creation
pull/771/head
Carlos Santos 2022-12-14 12:47:37 +01:00
parent c924cb9ab5
commit a48a6ffa32
3 changed files with 2 additions and 10 deletions

View File

@ -65,7 +65,6 @@ export class SessionComponent implements OnInit, OnDestroy {
@ContentChild('layout', { read: TemplateRef }) layoutTemplate: TemplateRef<any>; @ContentChild('layout', { read: TemplateRef }) layoutTemplate: TemplateRef<any>;
@Input() usedInPrejoinPage = false; @Input() usedInPrejoinPage = false;
@Output() onSessionCreated = new EventEmitter<any>();
@Output() onNodeCrashed = new EventEmitter<any>(); @Output() onNodeCrashed = new EventEmitter<any>();
@ -187,7 +186,6 @@ export class SessionComponent implements OnInit, OnDestroy {
if (recordingEnabled) { if (recordingEnabled) {
this.subscribeToRecordingEvents(); this.subscribeToRecordingEvents();
} }
this.onSessionCreated.emit(this.session);
await this.connectToSession(); await this.connectToSession();
// ios devices appear with blank video. Muting and unmuting it fix this problem // ios devices appear with blank video. Muting and unmuting it fix this problem

View File

@ -15,7 +15,7 @@
</div> </div>
<div [@inOutAnimation] id="vc-container" *ngIf="showVideoconference || (!showPrejoin && !loading && !error)"> <div [@inOutAnimation] id="vc-container" *ngIf="showVideoconference || (!showPrejoin && !loading && !error)">
<ov-session *ngIf="isSessionInitialized && !nodeCrashed" (onSessionCreated)="_onSessionCreated($event)" (onNodeCrashed)="_onNodeCrashed()"> <ov-session *ngIf="isSessionInitialized && !nodeCrashed" (onNodeCrashed)="_onNodeCrashed()">
<ng-template #toolbar> <ng-template #toolbar>
<ng-container *ngIf="openviduAngularToolbarTemplate"> <ng-container *ngIf="openviduAngularToolbarTemplate">
<ng-container *ngTemplateOutlet="openviduAngularToolbarTemplate"></ng-container> <ng-container *ngTemplateOutlet="openviduAngularToolbarTemplate"></ng-container>

View File

@ -559,6 +559,7 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
await this.initwebcamPublisher(); await this.initwebcamPublisher();
} }
this.isSessionInitialized = true; this.isSessionInitialized = true;
this.onSessionCreated.emit(this.openviduService.getWebcamSession());
this.onParticipantCreated.emit(this.participantService.getLocalParticipant()); this.onParticipantCreated.emit(this.participantService.getLocalParticipant());
this.loading = false; this.loading = false;
this.participantReady = true; this.participantReady = true;
@ -676,13 +677,6 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
this.onActivitiesPanelDeleteRecordingClicked.emit(recordingId); this.onActivitiesPanelDeleteRecordingClicked.emit(recordingId);
} }
/**
* @internal
*/
_onSessionCreated(session: Session) {
this.onSessionCreated.emit(session);
}
/** /**
* @internal * @internal
*/ */