mirror of https://github.com/OpenVidu/openvidu.git
openvidu-components: Emitted session created event
parent
6fc2ca0bc6
commit
88416b3981
|
@ -39,9 +39,9 @@ export class SessionComponent implements OnInit {
|
||||||
@ContentChild('panel', { read: TemplateRef }) panelTemplate: TemplateRef<any>;
|
@ContentChild('panel', { read: TemplateRef }) panelTemplate: TemplateRef<any>;
|
||||||
@ContentChild('layout', { read: TemplateRef }) layoutTemplate: TemplateRef<any>;
|
@ContentChild('layout', { read: TemplateRef }) layoutTemplate: TemplateRef<any>;
|
||||||
|
|
||||||
@Output() _session = new EventEmitter<any>();
|
@Output() onSessionCreated = new EventEmitter<any>();
|
||||||
@Output() _publisher = new EventEmitter<any>();
|
// @Output() _publisher = new EventEmitter<any>();
|
||||||
@Output() _error = new EventEmitter<any>();
|
// @Output() _error = new EventEmitter<any>();
|
||||||
|
|
||||||
session: Session;
|
session: Session;
|
||||||
sessionScreen: Session;
|
sessionScreen: Session;
|
||||||
|
@ -103,6 +103,7 @@ export class SessionComponent implements OnInit {
|
||||||
this.subscribeToNicknameChanged();
|
this.subscribeToNicknameChanged();
|
||||||
this.chatService.subscribeToChat();
|
this.chatService.subscribeToChat();
|
||||||
this.subscribeToReconnection();
|
this.subscribeToReconnection();
|
||||||
|
this.onSessionCreated.emit(this.session);
|
||||||
|
|
||||||
await this.connectToSession();
|
await this.connectToSession();
|
||||||
// Workaround, firefox does not have audio when publisher join with muted camera
|
// Workaround, firefox does not have audio when publisher join with muted camera
|
||||||
|
@ -110,8 +111,6 @@ export class SessionComponent implements OnInit {
|
||||||
// this.openviduService.publishVideo(this.localUserService.getMyCameraPublisher(), true);
|
// this.openviduService.publishVideo(this.localUserService.getMyCameraPublisher(), true);
|
||||||
// this.openviduService.publishVideo(this.localUserService.getMyCameraPublisher(), false);
|
// this.openviduService.publishVideo(this.localUserService.getMyCameraPublisher(), false);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
this._session.emit(this.session);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
@ -178,7 +177,7 @@ export class SessionComponent implements OnInit {
|
||||||
await this.openviduService.publish(this.participantService.getMyCameraPublisher());
|
await this.openviduService.publish(this.participantService.getMyCameraPublisher());
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this._error.emit({ error: error.error, messgae: error.message, code: error.code, status: error.status });
|
// this._error.emit({ error: error.error, messgae: error.message, code: error.code, status: error.status });
|
||||||
this.log.e('There was an error connecting to the session:', error.code, error.message);
|
this.log.e('There was an error connecting to the session:', error.code, error.message);
|
||||||
this.actionService.openDialog('There was an error connecting to the session:', error?.error || error?.message);
|
this.actionService.openDialog('There was an error connecting to the session:', error?.error || error?.message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="session-container" *ngIf="(joinSessionClicked || !showPrejoin) && participantReady && canPublish && !error">
|
<div id="session-container" *ngIf="(joinSessionClicked || !showPrejoin) && participantReady && canPublish && !error">
|
||||||
<ov-session>
|
<ov-session (onSessionCreated)="_onSessionCreated($event)">
|
||||||
<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>
|
||||||
|
|
|
@ -266,6 +266,9 @@ export class VideoconferenceComponent implements OnInit, OnDestroy, AfterViewIni
|
||||||
onChatPanelButtonClicked() {
|
onChatPanelButtonClicked() {
|
||||||
this.onToolbarChatPanelButtonClicked.emit();
|
this.onToolbarChatPanelButtonClicked.emit();
|
||||||
}
|
}
|
||||||
|
_onSessionCreated(event: any) {
|
||||||
|
this.onSessionCreated.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
private handlePublisherError(e: any) {
|
private handlePublisherError(e: any) {
|
||||||
let message: string;
|
let message: string;
|
||||||
|
|
Loading…
Reference in New Issue