2022-04-01 12:05:58 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2022-04-05 15:58:12 +02:00
|
|
|
import { TokenModel } from 'openvidu-angular';
|
|
|
|
import { RestService } from 'src/app/services/rest.service';
|
2022-04-01 12:05:58 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-panel-directive',
|
2022-04-05 15:58:12 +02:00
|
|
|
template: `
|
|
|
|
<ov-videoconference (onJoinButtonClicked)="onJoinButtonClicked()" [tokens]="tokens">
|
|
|
|
<div *ovPanel>
|
|
|
|
<div>HOLA?</div>
|
|
|
|
<div *ovChatPanel>
|
|
|
|
<ov-chat-panel></ov-chat-panel>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</ov-videoconference>
|
|
|
|
`
|
2022-04-01 12:05:58 +02:00
|
|
|
})
|
|
|
|
export class PanelDirectiveComponent implements OnInit {
|
2022-04-05 15:58:12 +02:00
|
|
|
tokens: TokenModel;
|
|
|
|
sessionId = 'panel-directive-example';
|
|
|
|
OPENVIDU_URL = 'https://localhost:4443';
|
|
|
|
OPENVIDU_SECRET = 'MY_SECRET';
|
|
|
|
constructor(private restService: RestService) {}
|
|
|
|
|
|
|
|
async onJoinButtonClicked() {
|
|
|
|
this.tokens = {
|
|
|
|
webcam: await this.restService.getToken(this.sessionId, this.OPENVIDU_URL, this.OPENVIDU_SECRET),
|
|
|
|
screen: await this.restService.getToken(this.sessionId, this.OPENVIDU_URL, this.OPENVIDU_SECRET)
|
|
|
|
};
|
|
|
|
}
|
2022-04-01 12:05:58 +02:00
|
|
|
|
|
|
|
ngOnInit(): void {}
|
|
|
|
}
|