Fix dl issue
This commit is contained in:
@@ -173,9 +173,9 @@ export class AppComponent implements OnInit {
|
|||||||
|
|
||||||
downloadFileFromAPI(filePath: string, filename: string, job: any) {
|
downloadFileFromAPI(filePath: string, filename: string, job: any) {
|
||||||
job.isDownloading = true;
|
job.isDownloading = true;
|
||||||
this.videoProcessingService.downloadFile(filePath).subscribe({
|
this.videoProcessingService.downloadFile(`${job.data.mp4Filename}/${filename}`).subscribe({
|
||||||
next: (response) => {
|
next: (response) => {
|
||||||
const blob = new Blob([response], { type: 'video/mp4' });
|
const blob = new Blob([response], { type: 'video/mkv' });
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
const a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ export class VideoProcessingService {
|
|||||||
return this.http.post<any>(`${this.apiUrl}/processUpdate`, data);
|
return this.http.post<any>(`${this.apiUrl}/processUpdate`, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFile(filePath: string): Observable<Blob> {
|
downloadFile(filename: string): Observable<Blob> {
|
||||||
return this.http.get(`${this.apiUrl}/download${filePath}`, { responseType: 'blob' });
|
return this.http.get(`${this.apiUrl}/download?filename=${encodeURIComponent(filename)}`, { responseType: 'blob' });
|
||||||
}
|
}
|
||||||
|
|
||||||
flushQueue(): Observable<any> {
|
flushQueue(): Observable<any> {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
serviceEndpoint: '/api'
|
serviceEndpoint: '/api'
|
||||||
|
//serviceEndpoint: 'http://192.168.1.230:6080/api'
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user