Files
CrawlFlix-Front/src/app/video-processing.service.ts
Joris Bertomeu 34e1d0f6dd
All checks were successful
ci / Image build (push) Successful in 2m59s
ci / Deployment (push) Successful in 9s
Add remux option
2025-08-25 15:17:32 +02:00

41 lines
1.2 KiB
TypeScript

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from '../environments/environment';
@Injectable({
providedIn: 'root'
})
export class VideoProcessingService {
private apiUrl = environment.serviceEndpoint;
constructor(private http: HttpClient) { }
startProcess(data: any): Observable<{ jobId: string }> {
return this.http.post<{ jobId: string }>(`${this.apiUrl}/start-process`, data);
}
load(data: any): Observable<any> {
return this.http.post<any>(`${this.apiUrl}/processMPD`, data);
}
getJobsStatus(): Observable<Array<any>> {
return this.http.get<Array<any>>(`${this.apiUrl}/jobs-status`);
}
hello(): Observable<Array<any>> {
return this.http.get<any>(`${this.apiUrl}/hello`);
}
processUpdate(data: any): Observable<any> {
return this.http.post<any>(`${this.apiUrl}/processUpdate`, data);
}
downloadFile(filePath: string): Observable<Blob> {
return this.http.get(`${this.apiUrl}/download${filePath}`, { responseType: 'blob' });
}
flushQueue(): Observable<any> {
return this.http.delete<any>(`${this.apiUrl}/jobs/completed`, {});
}
}