frontend: rename RecordingManagerService to RecordingService
This commit is contained in:
parent
134b2592e4
commit
02339b50b4
@ -15,7 +15,7 @@ import { MatInputModule } from '@angular/material/input';
|
|||||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
import { MatRadioModule } from '@angular/material/radio';
|
import { MatRadioModule } from '@angular/material/radio';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { RecordingManagerService } from '@lib/services';
|
import { RecordingService } from '@lib/services';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ov-share-recording-dialog',
|
selector: 'ov-share-recording-dialog',
|
||||||
@ -48,7 +48,7 @@ export class ShareRecordingDialogComponent {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(MAT_DIALOG_DATA) public data: { recordingId: string; recordingUrl?: string },
|
@Inject(MAT_DIALOG_DATA) public data: { recordingId: string; recordingUrl?: string },
|
||||||
private recordingService: RecordingManagerService,
|
private recordingService: RecordingService,
|
||||||
private clipboard: Clipboard
|
private clipboard: Clipboard
|
||||||
) {
|
) {
|
||||||
this.recordingUrl = data.recordingUrl;
|
this.recordingUrl = data.recordingUrl;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {
|
|||||||
GlobalPreferencesService,
|
GlobalPreferencesService,
|
||||||
NavigationService,
|
NavigationService,
|
||||||
ParticipantService,
|
ParticipantService,
|
||||||
RecordingManagerService,
|
RecordingService,
|
||||||
RoomService
|
RoomService
|
||||||
} from '@lib/services';
|
} from '@lib/services';
|
||||||
import { AuthMode, ParticipantRole } from '@lib/typings/ce';
|
import { AuthMode, ParticipantRole } from '@lib/typings/ce';
|
||||||
@ -107,7 +107,7 @@ export const checkRecordingAuthGuard: CanActivateFn = async (
|
|||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot
|
state: RouterStateSnapshot
|
||||||
) => {
|
) => {
|
||||||
const recordingService = inject(RecordingManagerService);
|
const recordingService = inject(RecordingService);
|
||||||
const navigationService = inject(NavigationService);
|
const navigationService = inject(NavigationService);
|
||||||
|
|
||||||
const recordingId = route.params['recording-id'];
|
const recordingId = route.params['recording-id'];
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { inject } from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
|
import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
|
||||||
import { ErrorReason } from '@lib/models';
|
import { ErrorReason } from '@lib/models';
|
||||||
import { NavigationService, ParticipantService, RecordingManagerService, RoomService } from '@lib/services';
|
import { NavigationService, ParticipantService, RecordingService, RoomService } from '@lib/services';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guard to validate the access to recordings of a room by generating a recording token.
|
* Guard to validate the access to recordings of a room by generating a recording token.
|
||||||
@ -11,7 +11,7 @@ export const validateRecordingAccessGuard: CanActivateFn = async (
|
|||||||
_state: RouterStateSnapshot
|
_state: RouterStateSnapshot
|
||||||
) => {
|
) => {
|
||||||
const roomService = inject(RoomService);
|
const roomService = inject(RoomService);
|
||||||
const recordingService = inject(RecordingManagerService);
|
const recordingService = inject(RecordingService);
|
||||||
const navigationService = inject(NavigationService);
|
const navigationService = inject(NavigationService);
|
||||||
|
|
||||||
const roomId = roomService.getRoomId();
|
const roomId = roomService.getRoomId();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';
|
import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';
|
||||||
import { inject } from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { AuthService, ParticipantService, RecordingManagerService, RoomService } from '@lib/services';
|
import { AuthService, ParticipantService, RecordingService, RoomService } from '@lib/services';
|
||||||
import { catchError, from, Observable, switchMap } from 'rxjs';
|
import { catchError, from, Observable, switchMap } from 'rxjs';
|
||||||
|
|
||||||
export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) => {
|
export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) => {
|
||||||
@ -9,7 +9,7 @@ export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, ne
|
|||||||
const authService: AuthService = inject(AuthService);
|
const authService: AuthService = inject(AuthService);
|
||||||
const roomService = inject(RoomService);
|
const roomService = inject(RoomService);
|
||||||
const participantTokenService = inject(ParticipantService);
|
const participantTokenService = inject(ParticipantService);
|
||||||
const recordingService = inject(RecordingManagerService);
|
const recordingService = inject(RecordingService);
|
||||||
|
|
||||||
const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url;
|
const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url;
|
||||||
const requestUrl = req.url;
|
const requestUrl = req.url;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import { MatCardModule } from '@angular/material/card';
|
import { MatCardModule } from '@angular/material/card';
|
||||||
import { MatGridListModule } from '@angular/material/grid-list';
|
import { MatGridListModule } from '@angular/material/grid-list';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { NavigationService, RecordingManagerService, RoomService } from '@lib/services';
|
import { NavigationService, RecordingService, RoomService } from '@lib/services';
|
||||||
import { MeetRecordingStatus, MeetRoom } from '@lib/typings/ce';
|
import { MeetRecordingStatus, MeetRoom } from '@lib/typings/ce';
|
||||||
|
|
||||||
interface OverviewStats {
|
interface OverviewStats {
|
||||||
@ -35,7 +35,7 @@ export class OverviewComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private roomService: RoomService,
|
private roomService: RoomService,
|
||||||
private recordingService: RecordingManagerService,
|
private recordingService: RecordingService,
|
||||||
private navigationService: NavigationService
|
private navigationService: NavigationService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { MatIconModule } from '@angular/material/icon';
|
|||||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { RecordingListsComponent, RecordingTableAction } from '@lib/components';
|
import { RecordingListsComponent, RecordingTableAction } from '@lib/components';
|
||||||
import { NotificationService, RecordingManagerService } from '@lib/services';
|
import { NotificationService, RecordingService } from '@lib/services';
|
||||||
import { MeetRecordingFilters, MeetRecordingInfo } from '@lib/typings/ce';
|
import { MeetRecordingFilters, MeetRecordingInfo } from '@lib/typings/ce';
|
||||||
import { ILogger, LoggerService } from 'openvidu-components-angular';
|
import { ILogger, LoggerService } from 'openvidu-components-angular';
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ export class RecordingsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected loggerService: LoggerService,
|
protected loggerService: LoggerService,
|
||||||
private recordingService: RecordingManagerService,
|
private recordingService: RecordingService,
|
||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
protected route: ActivatedRoute
|
protected route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import {
|
|||||||
NavigationService,
|
NavigationService,
|
||||||
NotificationService,
|
NotificationService,
|
||||||
ParticipantService,
|
ParticipantService,
|
||||||
RecordingManagerService,
|
RecordingService,
|
||||||
RoomService,
|
RoomService,
|
||||||
SessionStorageService,
|
SessionStorageService,
|
||||||
WebComponentManagerService
|
WebComponentManagerService
|
||||||
@ -106,8 +106,7 @@ export class MeetingComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected navigationService: NavigationService,
|
protected navigationService: NavigationService,
|
||||||
protected participantTokenService: ParticipantService,
|
protected recordingService: RecordingService,
|
||||||
protected recManagerService: RecordingManagerService,
|
|
||||||
protected authService: AuthService,
|
protected authService: AuthService,
|
||||||
protected roomService: RoomService,
|
protected roomService: RoomService,
|
||||||
protected meetingService: MeetingService,
|
protected meetingService: MeetingService,
|
||||||
@ -119,8 +118,7 @@ export class MeetingComponent implements OnInit {
|
|||||||
protected sessionStorageService: SessionStorageService,
|
protected sessionStorageService: SessionStorageService,
|
||||||
protected featureConfService: FeatureConfigurationService,
|
protected featureConfService: FeatureConfigurationService,
|
||||||
protected clipboard: Clipboard,
|
protected clipboard: Clipboard,
|
||||||
protected notificationService: NotificationService,
|
protected notificationService: NotificationService
|
||||||
protected recordingService: RecordingManagerService
|
|
||||||
) {
|
) {
|
||||||
this.features = this.featureConfService.features;
|
this.features = this.featureConfService.features;
|
||||||
}
|
}
|
||||||
@ -177,8 +175,8 @@ export class MeetingComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
private async checkForRecordings() {
|
private async checkForRecordings() {
|
||||||
try {
|
try {
|
||||||
await this.recManagerService.generateRecordingToken(this.roomId, this.roomSecret);
|
await this.recordingService.generateRecordingToken(this.roomId, this.roomSecret);
|
||||||
const { recordings } = await this.recManagerService.listRecordings({
|
const { recordings } = await this.recordingService.listRecordings({
|
||||||
maxItems: 1,
|
maxItems: 1,
|
||||||
roomId: this.roomId,
|
roomId: this.roomId,
|
||||||
fields: 'recordingId'
|
fields: 'recordingId'
|
||||||
@ -201,7 +199,7 @@ export class MeetingComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
private async initializeParticipantName() {
|
private async initializeParticipantName() {
|
||||||
// Apply participant name from ParticipantTokenService if set, otherwise use authenticated username
|
// Apply participant name from ParticipantTokenService if set, otherwise use authenticated username
|
||||||
const currentParticipantName = this.participantTokenService.getParticipantName();
|
const currentParticipantName = this.participantService.getParticipantName();
|
||||||
const username = await this.authService.getUsername();
|
const username = await this.authService.getUsername();
|
||||||
const participantName = currentParticipantName || username;
|
const participantName = currentParticipantName || username;
|
||||||
|
|
||||||
@ -251,7 +249,7 @@ export class MeetingComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.participantName = value.name.trim();
|
this.participantName = value.name.trim();
|
||||||
this.participantTokenService.setParticipantName(this.participantName);
|
this.participantService.setParticipantName(this.participantName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.generateParticipantToken();
|
await this.generateParticipantToken();
|
||||||
@ -282,7 +280,7 @@ export class MeetingComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
private async generateParticipantToken() {
|
private async generateParticipantToken() {
|
||||||
try {
|
try {
|
||||||
this.participantToken = await this.participantTokenService.generateToken({
|
this.participantToken = await this.participantService.generateToken({
|
||||||
roomId: this.roomId,
|
roomId: this.roomId,
|
||||||
secret: this.roomSecret,
|
secret: this.roomSecret,
|
||||||
participantName: this.participantName
|
participantName: this.participantName
|
||||||
@ -465,11 +463,13 @@ export class MeetingComponent implements OnInit {
|
|||||||
|
|
||||||
async onRecordingStartRequested(event: RecordingStartRequestedEvent) {
|
async onRecordingStartRequested(event: RecordingStartRequestedEvent) {
|
||||||
try {
|
try {
|
||||||
await this.recManagerService.startRecording(event.roomName);
|
await this.recordingService.startRecording(event.roomName);
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if ((error as any).status === 503) {
|
if ((error as any).status === 503) {
|
||||||
console.error(
|
console.error(
|
||||||
"No egress service was able to register a request. Check your CPU usage or if there's any Media Node with enough CPU. Remember that by default, a recording uses 4 CPUs for each room."
|
`No egress service was able to register a request.
|
||||||
|
Check your CPU usage or if there's any Media Node with enough CPU.
|
||||||
|
Remember that by default, a recording uses 4 CPUs for each room.`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -479,7 +479,7 @@ export class MeetingComponent implements OnInit {
|
|||||||
|
|
||||||
async onRecordingStopRequested(event: RecordingStopRequestedEvent) {
|
async onRecordingStopRequested(event: RecordingStopRequestedEvent) {
|
||||||
try {
|
try {
|
||||||
await this.recManagerService.stopRecording(event.recordingId);
|
await this.recordingService.stopRecording(event.recordingId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|||||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { RecordingListsComponent, RecordingTableAction } from '@lib/components';
|
import { RecordingListsComponent, RecordingTableAction } from '@lib/components';
|
||||||
import { NavigationService, NotificationService, RecordingManagerService, RoomService } from '@lib/services';
|
import { NavigationService, NotificationService, RecordingService, RoomService } from '@lib/services';
|
||||||
import { MeetRecordingFilters, MeetRecordingInfo } from '@lib/typings/ce';
|
import { MeetRecordingFilters, MeetRecordingInfo } from '@lib/typings/ce';
|
||||||
import { ILogger, LoggerService } from 'openvidu-components-angular';
|
import { ILogger, LoggerService } from 'openvidu-components-angular';
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ export class RoomRecordingsComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected loggerService: LoggerService,
|
protected loggerService: LoggerService,
|
||||||
protected recordingService: RecordingManagerService,
|
protected recordingService: RecordingService,
|
||||||
protected roomService: RoomService,
|
protected roomService: RoomService,
|
||||||
protected notificationService: NotificationService,
|
protected notificationService: NotificationService,
|
||||||
protected navigationService: NavigationService,
|
protected navigationService: NavigationService,
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|||||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { NotificationService, RecordingManagerService } from '@lib/services';
|
import { NotificationService, RecordingService } from '@lib/services';
|
||||||
import { MeetRecordingInfo, MeetRecordingStatus } from '@lib/typings/ce';
|
import { MeetRecordingInfo, MeetRecordingStatus } from '@lib/typings/ce';
|
||||||
import { formatDurationToTime } from '@lib/utils';
|
import { formatDurationToTime } from '@lib/utils';
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export class ViewRecordingComponent implements OnInit {
|
|||||||
isVideoLoaded = false;
|
isVideoLoaded = false;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected recordingService: RecordingManagerService,
|
protected recordingService: RecordingService,
|
||||||
protected notificationService: NotificationService,
|
protected notificationService: NotificationService,
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected router: Router
|
protected router: Router
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export * from './room.service';
|
|||||||
export * from './participant.service';
|
export * from './participant.service';
|
||||||
export * from './meeting.service';
|
export * from './meeting.service';
|
||||||
export * from './feature-configuration.service';
|
export * from './feature-configuration.service';
|
||||||
export * from './recording-manager.service';
|
export * from './recording.service';
|
||||||
export * from './webcomponent-manager.service';
|
export * from './webcomponent-manager.service';
|
||||||
export * from './navigation.service';
|
export * from './navigation.service';
|
||||||
export * from './notification.service';
|
export * from './notification.service';
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { LoggerService } from 'openvidu-components-angular';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class RecordingManagerService {
|
export class RecordingService {
|
||||||
protected readonly RECORDINGS_API = `${HttpService.API_PATH_PREFIX}/recordings`;
|
protected readonly RECORDINGS_API = `${HttpService.API_PATH_PREFIX}/recordings`;
|
||||||
protected readonly INTERNAL_RECORDINGS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/recordings`;
|
protected readonly INTERNAL_RECORDINGS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/recordings`;
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user