first commit
This commit is contained in:
24
src/app/video-processing.service.ts
Normal file
24
src/app/video-processing.service.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class VideoProcessingService {
|
||||
private apiUrl = 'http://localhost:3000';
|
||||
|
||||
constructor(private http: HttpClient) { }
|
||||
|
||||
startProcess(data: any): Observable<{ jobId: string }> {
|
||||
return this.http.post<{ jobId: string }>(`${this.apiUrl}/start-process`, data);
|
||||
}
|
||||
|
||||
getJobsStatus(): Observable<Array<any>> {
|
||||
return this.http.get<Array<any>>(`${this.apiUrl}/jobs-status`);
|
||||
}
|
||||
|
||||
downloadFile(filePath: string): Observable<Blob> {
|
||||
return this.http.get(`${this.apiUrl}/download/${filePath}`, { responseType: 'blob' });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user