ffmpegwasm / ffmpegwasm/ffmpeg.wasm

SecurityError: Failed to construct 'Worker'

Đang mở
#560 13 bình luận 9 reaction 0 người được giao Xem trên GitHub
help wanted
Ngôn ngữ chính
C
Star
17.8k
Fork
1.1k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the bug**
I'm encountering an issue while trying to use the @ffmpeg/ffmpeg library within my Angular project. The problem seems to be related to CORS issues when attempting to access the worker.js file from the library. Despite following the recommended solutions, I'm still facing this problem.

**Code**
```
import { Injectable } from '@angular/core';
import { FFmpeg } from '@ffmpeg/ffmpeg';

@Injectable({
providedIn: 'root',
})
export class FfmpegService {
isLoad: boolean = false;
private ffmpeg;

constructor() {
this.ffmpeg = new FFmpeg();
}

async init() {
if (this.isLoad) {
return;
}

this.ffmpeg.on('log', ({ message }) => {
console.log(message);
});

await this.ffmpeg.load();

this.isLoad = true;
}
}
```

**Screenshots**
Screenshot 2023-08-22 at 11 21 22

**Desktop (please complete the following information):**
- Angular version: "^16.1.0"
- Angular CLI: 16.1.8
- Node: 18.17.0
- Package Manager: yarn 1.22.5
- OS: MocOS Catalina version 10.15.7
- @ffmpeg/ffmpeg: "^0.12.5"
- @ffmpeg/util: "^0.12.0"
- Browser(s) affected: Brave v 1.57.47 Chrome v 116.0.5845.96, Firefox v 116.0.3

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.