diff --git a/openvidu-insecure-angular/src/app/app.component.html b/openvidu-insecure-angular/src/app/app.component.html index cae74dd5..3aef9778 100644 --- a/openvidu-insecure-angular/src/app/app.component.html +++ b/openvidu-insecure-angular/src/app/app.component.html @@ -29,10 +29,10 @@
- +
- +
diff --git a/openvidu-insecure-angular/src/app/app.component.ts b/openvidu-insecure-angular/src/app/app.component.ts index 68c6593a..3d814071 100644 --- a/openvidu-insecure-angular/src/app/app.component.ts +++ b/openvidu-insecure-angular/src/app/app.component.ts @@ -1,9 +1,9 @@ -import { Component, HostListener, Input, OnDestroy } from '@angular/core'; import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { throwError as observableThrowError, Observable } from 'rxjs'; +import { Component, HostListener, OnDestroy } from '@angular/core'; +import { OpenVidu, Publisher, Session, StreamEvent, StreamManager, Subscriber } from 'openvidu-browser'; +import { throwError as observableThrowError } from 'rxjs'; import { catchError } from 'rxjs/operators'; -import { OpenVidu, Session, StreamManager, Publisher, Subscriber, StreamEvent } from 'openvidu-browser'; @Component({ selector: 'app-root', @@ -26,8 +26,8 @@ export class AppComponent implements OnDestroy { myUserName: string; // Main video of the page, will be 'publisher' or one of the 'subscribers', - // updated by an Output event of UserVideoComponent children - @Input() mainStreamManager: StreamManager; + // updated by click event in UserVideoComponent children + mainStreamManager: StreamManager; constructor(private httpClient: HttpClient) { this.generateParticipantInfo(); @@ -140,7 +140,7 @@ export class AppComponent implements OnDestroy { } } - private updateMainStreamManager(streamManager: StreamManager) { + updateMainStreamManager(streamManager: StreamManager) { this.mainStreamManager = streamManager; } @@ -152,7 +152,7 @@ export class AppComponent implements OnDestroy { * -------------------------- * This method retrieve the mandatory user token from OpenVidu Server, * in this case making use Angular http API. - * This behaviour MUST BE IN YOUR SERVER-SIDE IN PRODUCTION. In this case: + * This behavior MUST BE IN YOUR SERVER-SIDE IN PRODUCTION. In this case: * 1) Initialize a session in OpenVidu Server (POST /api/sessions) * 2) Generate a token in OpenVidu Server (POST /api/tokens) * 3) The token must be consumed in Session.connect() method of OpenVidu Browser diff --git a/openvidu-insecure-angular/src/app/ov-video.component.ts b/openvidu-insecure-angular/src/app/ov-video.component.ts index 13ecd2bc..38a76fe8 100644 --- a/openvidu-insecure-angular/src/app/ov-video.component.ts +++ b/openvidu-insecure-angular/src/app/ov-video.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, ViewChild, ElementRef, AfterViewInit } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, Input, ViewChild } from '@angular/core'; import { StreamManager } from 'openvidu-browser'; @Component({ diff --git a/openvidu-insecure-angular/src/app/user-video.component.ts b/openvidu-insecure-angular/src/app/user-video.component.ts index a6139020..813565dc 100644 --- a/openvidu-insecure-angular/src/app/user-video.component.ts +++ b/openvidu-insecure-angular/src/app/user-video.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { StreamManager } from 'openvidu-browser'; @Component({ @@ -23,7 +23,7 @@ import { StreamManager } from 'openvidu-browser'; margin: 0; }`], template: ` -
+

{{getNicknameTag()}}

` @@ -33,15 +33,7 @@ export class UserVideoComponent { @Input() streamManager: StreamManager; - @Output() - clicked = new EventEmitter(); - getNicknameTag() { // Gets the nickName of the user return JSON.parse(this.streamManager.stream.connection.data).clientData; } - - videoClicked() { // Triggers event for the parent component to update its main video display (other UserVideoComponent) - this.clicked.emit(); - } - }