frontend: add onRoomCreated event handler to manage room preferences updates
This commit is contained in:
parent
7361b71a7a
commit
4ebc5a2e16
@ -133,6 +133,7 @@
|
|||||||
(onParticipantLeft)="onParticipantLeft($event)"
|
(onParticipantLeft)="onParticipantLeft($event)"
|
||||||
(onRecordingStartRequested)="onRecordingStartRequested($event)"
|
(onRecordingStartRequested)="onRecordingStartRequested($event)"
|
||||||
(onRecordingStopRequested)="onRecordingStopRequested($event)"
|
(onRecordingStopRequested)="onRecordingStopRequested($event)"
|
||||||
|
(onRoomCreated)="onRoomCreated($event)"
|
||||||
>
|
>
|
||||||
@if (features().canModerateRoom) {
|
@if (features().canModerateRoom) {
|
||||||
<div *ovToolbarAdditionalButtons>
|
<div *ovToolbarAdditionalButtons>
|
||||||
|
|||||||
@ -23,16 +23,27 @@ import {
|
|||||||
SessionStorageService,
|
SessionStorageService,
|
||||||
WebComponentManagerService
|
WebComponentManagerService
|
||||||
} from '@lib/services';
|
} from '@lib/services';
|
||||||
import { ParticipantRole, WebComponentEvent, WebComponentOutboundEventMessage } from '@lib/typings/ce';
|
import {
|
||||||
|
MeetRoomPreferences,
|
||||||
|
ParticipantRole,
|
||||||
|
WebComponentEvent,
|
||||||
|
WebComponentOutboundEventMessage
|
||||||
|
} from '@lib/typings/ce';
|
||||||
|
import { MeetSignalType } from '@lib/typings/ce/event.model';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ApiDirectiveModule,
|
ApiDirectiveModule,
|
||||||
|
DataPacket_Kind,
|
||||||
OpenViduComponentsUiModule,
|
OpenViduComponentsUiModule,
|
||||||
OpenViduService,
|
OpenViduService,
|
||||||
ParticipantLeftEvent,
|
ParticipantLeftEvent,
|
||||||
ParticipantLeftReason,
|
ParticipantLeftReason,
|
||||||
ParticipantModel,
|
ParticipantModel,
|
||||||
RecordingStartRequestedEvent,
|
RecordingStartRequestedEvent,
|
||||||
RecordingStopRequestedEvent
|
RecordingStopRequestedEvent,
|
||||||
|
RemoteParticipant,
|
||||||
|
Room,
|
||||||
|
RoomEvent
|
||||||
} from 'openvidu-components-angular';
|
} from 'openvidu-components-angular';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -100,6 +111,19 @@ export class VideoRoomComponent implements OnInit, OnDestroy {
|
|||||||
this.wcManagerService.stopCommandsListener();
|
this.wcManagerService.stopCommandsListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onRoomCreated(room: Room) {
|
||||||
|
room.on(
|
||||||
|
RoomEvent.DataReceived,
|
||||||
|
(payload: Uint8Array, participant?: RemoteParticipant, _?: DataPacket_Kind, topic?: string) => {
|
||||||
|
const event = JSON.parse(new TextDecoder().decode(payload));
|
||||||
|
if (topic === MeetSignalType.MEET_ROOM_PREFERENCES_UPDATED) {
|
||||||
|
const roomPreferences: MeetRoomPreferences = event.preferences;
|
||||||
|
this.featureConfService.setRoomPreferences(roomPreferences);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
get isAdmin(): boolean {
|
get isAdmin(): boolean {
|
||||||
return this.authService.isAdmin();
|
return this.authService.isAdmin();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user