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">
|
2022-04-28 13:09:42 +02:00
|
|
|
<ov-panel *ovPanel>
|
|
|
|
<div *ovChatPanel id="my-chat-panel">This is my custom chat panel</div>
|
|
|
|
<div *ovParticipantsPanel id="my-participants-panel">This is my custom participants panel</div>
|
|
|
|
</ov-panel>
|
2022-04-05 15:58:12 +02:00
|
|
|
</ov-videoconference>
|
2022-04-28 13:09:42 +02:00
|
|
|
`,
|
|
|
|
styles: [
|
|
|
|
`
|
|
|
|
#my-chat-panel, #my-participants-panel {
|
|
|
|
text-align: center;
|
|
|
|
height: calc(100% - 40px);
|
|
|
|
margin: 20px;
|
|
|
|
}
|
|
|
|
#my-chat-panel {
|
|
|
|
background: #c9ffb2;
|
|
|
|
}
|
|
|
|
#my-participants-panel {
|
|
|
|
background: #ddf2ff;
|
|
|
|
}
|
|
|
|
`
|
|
|
|
]
|
2022-04-01 12:05:58 +02:00
|
|
|
})
|
2022-04-28 13:09:42 +02:00
|
|
|
export class PanelDirectiveComponent {
|
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
|
|
|
}
|