frontend: Update ApplicationFeatures interface to include new UI controls and adjust permissions handling
This commit is contained in:
parent
78cfc3035e
commit
9293568ccd
@ -21,21 +21,72 @@ export enum Edition {
|
||||
*/
|
||||
export interface ApplicationFeatures {
|
||||
// Media Features
|
||||
/**
|
||||
* Indicates if video is enabled for the participant
|
||||
*/
|
||||
videoEnabled: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if audio is enabled for the participant
|
||||
*/
|
||||
audioEnabled: boolean;
|
||||
|
||||
|
||||
// UI Controls
|
||||
/**
|
||||
* Indicates if camera control is shown in the UI
|
||||
*/
|
||||
showCamera: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if microphone control is shown in the UI
|
||||
*/
|
||||
showMicrophone: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if screen share control is shown in the UI
|
||||
*/
|
||||
showScreenShare: boolean;
|
||||
|
||||
// UI Features
|
||||
/**
|
||||
* Indicates if the recording panel is shown in the UI
|
||||
*/
|
||||
showRecordingPanel: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the chat panel is shown in the UI
|
||||
*/
|
||||
showChat: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the virtual backgrounds feature is shown in the UI
|
||||
*/
|
||||
showBackgrounds: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the participant list is shown in the UI
|
||||
*/
|
||||
showParticipantList: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the settings panel is shown in the UI
|
||||
*/
|
||||
showSettings: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the fullscreen control is shown in the UI
|
||||
*/
|
||||
showFullscreen: boolean;
|
||||
|
||||
/**
|
||||
* Indicates if the theme selector is shown in the UI
|
||||
*/
|
||||
showThemeSelector: boolean;
|
||||
allowLayoutSwitching: boolean; // flag for allowing smart layout. It's changed manually.
|
||||
|
||||
/**
|
||||
* Flag for allowing smart layout. It's changed manually.
|
||||
*/
|
||||
allowLayoutSwitching: boolean;
|
||||
|
||||
// Permissions
|
||||
canModerateRoom: boolean;
|
||||
|
||||
@ -3,8 +3,7 @@ import {
|
||||
MeetAppearanceConfig,
|
||||
MeetRoomConfig,
|
||||
MeetRoomMemberPermissions,
|
||||
MeetRoomMemberRole,
|
||||
TrackSource
|
||||
MeetRoomMemberRole
|
||||
} from '@openvidu-meet/typings';
|
||||
import { LoggerService } from 'openvidu-components-angular';
|
||||
import { ApplicationFeatures } from '../models/app.model';
|
||||
@ -121,24 +120,23 @@ export class FeatureConfigurationService {
|
||||
if (permissions) {
|
||||
// Only restrict if the feature is already enabled
|
||||
if (features.showRecordingPanel) {
|
||||
features.canRecordRoom = permissions.meet.canRecord;
|
||||
features.canRetrieveRecordings = permissions.meet.canRetrieveRecordings;
|
||||
features.canRecordRoom = permissions.canRecord;
|
||||
features.canRetrieveRecordings = permissions.canRetrieveRecordings;
|
||||
}
|
||||
if (features.showChat) {
|
||||
features.showChat = permissions.meet.canChat;
|
||||
features.showChat = permissions.canReadChat;
|
||||
// TODO: Handle canWriteChat permissions
|
||||
}
|
||||
if (features.showBackgrounds) {
|
||||
features.showBackgrounds = permissions.meet.canChangeVirtualBackground;
|
||||
features.showBackgrounds = permissions.canChangeVirtualBackground;
|
||||
}
|
||||
|
||||
// Media features
|
||||
const canPublish = permissions.livekit.canPublish;
|
||||
const canPublishSources = permissions.livekit.canPublishSources ?? [];
|
||||
features.videoEnabled = canPublish || canPublishSources.includes(TrackSource.CAMERA);
|
||||
features.audioEnabled = canPublish || canPublishSources.includes(TrackSource.MICROPHONE);
|
||||
features.videoEnabled = permissions.canPublishVideo;
|
||||
features.audioEnabled = permissions.canPublishAudio;
|
||||
features.showScreenShare = permissions.canShareScreen;
|
||||
features.showCamera = features.videoEnabled;
|
||||
features.showMicrophone = features.audioEnabled;
|
||||
features.showScreenShare = canPublish || canPublishSources.includes(TrackSource.SCREEN_SHARE);
|
||||
}
|
||||
|
||||
// Apply role-based configurations
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user