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 { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { RecordingManagerService } from '@lib/services';
|
||||
import { RecordingService } from '@lib/services';
|
||||
|
||||
@Component({
|
||||
selector: 'ov-share-recording-dialog',
|
||||
@ -48,7 +48,7 @@ export class ShareRecordingDialogComponent {
|
||||
|
||||
constructor(
|
||||
@Inject(MAT_DIALOG_DATA) public data: { recordingId: string; recordingUrl?: string },
|
||||
private recordingService: RecordingManagerService,
|
||||
private recordingService: RecordingService,
|
||||
private clipboard: Clipboard
|
||||
) {
|
||||
this.recordingUrl = data.recordingUrl;
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
GlobalPreferencesService,
|
||||
NavigationService,
|
||||
ParticipantService,
|
||||
RecordingManagerService,
|
||||
RecordingService,
|
||||
RoomService
|
||||
} from '@lib/services';
|
||||
import { AuthMode, ParticipantRole } from '@lib/typings/ce';
|
||||
@ -107,7 +107,7 @@ export const checkRecordingAuthGuard: CanActivateFn = async (
|
||||
route: ActivatedRouteSnapshot,
|
||||
state: RouterStateSnapshot
|
||||
) => {
|
||||
const recordingService = inject(RecordingManagerService);
|
||||
const recordingService = inject(RecordingService);
|
||||
const navigationService = inject(NavigationService);
|
||||
|
||||
const recordingId = route.params['recording-id'];
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
|
||||
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.
|
||||
@ -11,7 +11,7 @@ export const validateRecordingAccessGuard: CanActivateFn = async (
|
||||
_state: RouterStateSnapshot
|
||||
) => {
|
||||
const roomService = inject(RoomService);
|
||||
const recordingService = inject(RecordingManagerService);
|
||||
const recordingService = inject(RecordingService);
|
||||
const navigationService = inject(NavigationService);
|
||||
|
||||
const roomId = roomService.getRoomId();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';
|
||||
import { inject } from '@angular/core';
|
||||
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';
|
||||
|
||||
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 roomService = inject(RoomService);
|
||||
const participantTokenService = inject(ParticipantService);
|
||||
const recordingService = inject(RecordingManagerService);
|
||||
const recordingService = inject(RecordingService);
|
||||
|
||||
const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url;
|
||||
const requestUrl = req.url;
|
||||
|
||||
@ -4,7 +4,7 @@ import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
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';
|
||||
|
||||
interface OverviewStats {
|
||||
@ -35,7 +35,7 @@ export class OverviewComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private roomService: RoomService,
|
||||
private recordingService: RecordingManagerService,
|
||||
private recordingService: RecordingService,
|
||||
private navigationService: NavigationService
|
||||
) {}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
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 { ILogger, LoggerService } from 'openvidu-components-angular';
|
||||
|
||||
@ -27,7 +27,7 @@ export class RecordingsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
protected loggerService: LoggerService,
|
||||
private recordingService: RecordingManagerService,
|
||||
private recordingService: RecordingService,
|
||||
private notificationService: NotificationService,
|
||||
protected route: ActivatedRoute
|
||||
) {
|
||||
|
||||
@ -23,7 +23,7 @@ import {
|
||||
NavigationService,
|
||||
NotificationService,
|
||||
ParticipantService,
|
||||
RecordingManagerService,
|
||||
RecordingService,
|
||||
RoomService,
|
||||
SessionStorageService,
|
||||
WebComponentManagerService
|
||||
@ -106,8 +106,7 @@ export class MeetingComponent implements OnInit {
|
||||
constructor(
|
||||
protected route: ActivatedRoute,
|
||||
protected navigationService: NavigationService,
|
||||
protected participantTokenService: ParticipantService,
|
||||
protected recManagerService: RecordingManagerService,
|
||||
protected recordingService: RecordingService,
|
||||
protected authService: AuthService,
|
||||
protected roomService: RoomService,
|
||||
protected meetingService: MeetingService,
|
||||
@ -119,8 +118,7 @@ export class MeetingComponent implements OnInit {
|
||||
protected sessionStorageService: SessionStorageService,
|
||||
protected featureConfService: FeatureConfigurationService,
|
||||
protected clipboard: Clipboard,
|
||||
protected notificationService: NotificationService,
|
||||
protected recordingService: RecordingManagerService
|
||||
protected notificationService: NotificationService
|
||||
) {
|
||||
this.features = this.featureConfService.features;
|
||||
}
|
||||
@ -177,8 +175,8 @@ export class MeetingComponent implements OnInit {
|
||||
*/
|
||||
private async checkForRecordings() {
|
||||
try {
|
||||
await this.recManagerService.generateRecordingToken(this.roomId, this.roomSecret);
|
||||
const { recordings } = await this.recManagerService.listRecordings({
|
||||
await this.recordingService.generateRecordingToken(this.roomId, this.roomSecret);
|
||||
const { recordings } = await this.recordingService.listRecordings({
|
||||
maxItems: 1,
|
||||
roomId: this.roomId,
|
||||
fields: 'recordingId'
|
||||
@ -201,7 +199,7 @@ export class MeetingComponent implements OnInit {
|
||||
*/
|
||||
private async initializeParticipantName() {
|
||||
// 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 participantName = currentParticipantName || username;
|
||||
|
||||
@ -251,7 +249,7 @@ export class MeetingComponent implements OnInit {
|
||||
}
|
||||
|
||||
this.participantName = value.name.trim();
|
||||
this.participantTokenService.setParticipantName(this.participantName);
|
||||
this.participantService.setParticipantName(this.participantName);
|
||||
|
||||
try {
|
||||
await this.generateParticipantToken();
|
||||
@ -282,7 +280,7 @@ export class MeetingComponent implements OnInit {
|
||||
*/
|
||||
private async generateParticipantToken() {
|
||||
try {
|
||||
this.participantToken = await this.participantTokenService.generateToken({
|
||||
this.participantToken = await this.participantService.generateToken({
|
||||
roomId: this.roomId,
|
||||
secret: this.roomSecret,
|
||||
participantName: this.participantName
|
||||
@ -465,11 +463,13 @@ export class MeetingComponent implements OnInit {
|
||||
|
||||
async onRecordingStartRequested(event: RecordingStartRequestedEvent) {
|
||||
try {
|
||||
await this.recManagerService.startRecording(event.roomName);
|
||||
await this.recordingService.startRecording(event.roomName);
|
||||
} catch (error: unknown) {
|
||||
if ((error as any).status === 503) {
|
||||
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 {
|
||||
console.error(error);
|
||||
@ -479,7 +479,7 @@ export class MeetingComponent implements OnInit {
|
||||
|
||||
async onRecordingStopRequested(event: RecordingStopRequestedEvent) {
|
||||
try {
|
||||
await this.recManagerService.stopRecording(event.recordingId);
|
||||
await this.recordingService.stopRecording(event.recordingId);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
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 { ILogger, LoggerService } from 'openvidu-components-angular';
|
||||
|
||||
@ -33,7 +33,7 @@ export class RoomRecordingsComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
protected loggerService: LoggerService,
|
||||
protected recordingService: RecordingManagerService,
|
||||
protected recordingService: RecordingService,
|
||||
protected roomService: RoomService,
|
||||
protected notificationService: NotificationService,
|
||||
protected navigationService: NavigationService,
|
||||
|
||||
@ -7,7 +7,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
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 { formatDurationToTime } from '@lib/utils';
|
||||
|
||||
@ -35,7 +35,7 @@ export class ViewRecordingComponent implements OnInit {
|
||||
isVideoLoaded = false;
|
||||
|
||||
constructor(
|
||||
protected recordingService: RecordingManagerService,
|
||||
protected recordingService: RecordingService,
|
||||
protected notificationService: NotificationService,
|
||||
protected route: ActivatedRoute,
|
||||
protected router: Router
|
||||
|
||||
@ -6,7 +6,7 @@ export * from './room.service';
|
||||
export * from './participant.service';
|
||||
export * from './meeting.service';
|
||||
export * from './feature-configuration.service';
|
||||
export * from './recording-manager.service';
|
||||
export * from './recording.service';
|
||||
export * from './webcomponent-manager.service';
|
||||
export * from './navigation.service';
|
||||
export * from './notification.service';
|
||||
|
||||
@ -9,7 +9,7 @@ import { LoggerService } from 'openvidu-components-angular';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RecordingManagerService {
|
||||
export class RecordingService {
|
||||
protected readonly RECORDINGS_API = `${HttpService.API_PATH_PREFIX}/recordings`;
|
||||
protected readonly INTERNAL_RECORDINGS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/recordings`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user