Skip to content

Commit 004f4e5

Browse files
authored
Merge pull request #850 from SukkaW/jsd
fix: replace unpkg w/ jsdelivr
2 parents 8df7442 + 2b29efc commit 004f4e5

File tree

12 files changed

+50
-50
lines changed

12 files changed

+50
-50
lines changed

apps/angular-app/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { RouterOutlet } from '@angular/router';
44
import { FFmpeg } from '@ffmpeg/ffmpeg';
55
import { fetchFile, toBlobURL } from '@ffmpeg/util';
66

7-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected]/dist/esm';
7+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm';
88

99
@Component({
1010
selector: 'app-root',

apps/nextjs-app/app/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function Home() {
1313

1414
const load = async () => {
1515
setIsLoading(true);
16-
const baseURL = "https://unpkg.com/@ffmpeg/[email protected]/dist/umd";
16+
const baseURL = "https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd";
1717
const ffmpeg = ffmpegRef.current;
1818
ffmpeg.on("log", ({ message }) => {
1919
if (messageRef.current) messageRef.current.innerHTML = message;

apps/react-vite-app/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function App() {
99
const messageRef = useRef<HTMLParagraphElement | null>(null);
1010

1111
const load = async () => {
12-
const baseURL = "https://unpkg.com/@ffmpeg/[email protected]/dist/esm";
12+
const baseURL = "https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm";
1313
const ffmpeg = ffmpegRef.current;
1414
ffmpeg.on("log", ({ message }) => {
1515
if (messageRef.current) messageRef.current.innerHTML = message;

apps/solidstart-app/package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "solidstart-ffmpeg",
3-
"type": "module",
4-
"scripts": {
5-
"dev": "vinxi dev",
6-
"build": "vinxi build",
7-
"start": "vinxi start"
8-
},
9-
"dependencies": {
10-
"@ffmpeg/ffmpeg": "^0.12.15",
11-
"@ffmpeg/util": "^0.12.2",
12-
"@solidjs/router": "^0.14.1",
13-
"@solidjs/start": "^1.0.4",
14-
"autoprefixer": "^10.4.19",
15-
"postcss": "^8.4.38",
16-
"solid-js": "^1.8.18",
17-
"tailwindcss": "^3.4.3",
18-
"vinxi": "^0.3.14"
19-
},
20-
"engines": {
21-
"node": ">=18"
22-
}
2+
"name": "solidstart-ffmpeg",
3+
"type": "module",
4+
"scripts": {
5+
"dev": "vinxi dev",
6+
"build": "vinxi build",
7+
"start": "vinxi start"
8+
},
9+
"dependencies": {
10+
"@ffmpeg/ffmpeg": "^0.12.15",
11+
"@ffmpeg/util": "^0.12.2",
12+
"@solidjs/router": "^0.14.1",
13+
"@solidjs/start": "^1.0.4",
14+
"autoprefixer": "^10.4.19",
15+
"postcss": "^8.4.38",
16+
"solid-js": "^1.8.18",
17+
"tailwindcss": "^3.4.3",
18+
"vinxi": "^0.5.7"
19+
},
20+
"engines": {
21+
"node": ">=18"
22+
}
2323
}

apps/solidstart-app/src/routes/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FFmpeg } from '@ffmpeg/ffmpeg';
22
import { fetchFile, toBlobURL } from '@ffmpeg/util';
33
import { createSignal, Show } from 'solid-js';
44

5-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/esm';
5+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/esm';
66
const videoURL =
77
'https://raw.githubusercontent.com/ffmpegwasm/testdata/master/video-15s.avi';
88

apps/sveltekit-app/src/lib/FFmpegDemo.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
let videoEl: HTMLVideoElement;
88
9-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/esm';
9+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/esm';
1010
const videoURL = 'https://raw.githubusercontent.com/ffmpegwasm/testdata/master/video-15s.avi';
1111
1212
let message = 'Click Start to Transcode';

apps/vue-vite-app/src/components/FFmpegDemo.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import type { LogEvent } from '@ffmpeg/ffmpeg/dist/esm/types'
1111
import { fetchFile, toBlobURL } from '@ffmpeg/util'
1212
import { defineComponent, ref } from 'vue'
1313
14-
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].9/dist/esm'
14+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/esm'
1515
const videoURL = 'https://raw.githubusercontent.com/ffmpegwasm/testdata/master/video-15s.avi'
1616
1717
export default defineComponent({

apps/website/docs/getting-started/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ yarn add @ffmpeg/ffmpeg @ffmpeg/util
3131

3232
:::info
3333
As `@ffmpeg/ffmpeg` spawns a web worker, you cannot import `@ffmpeg/ffmpeg` from CDN like
34-
unpkg. It is recommended to download it and host it on your server most of the time.
34+
jsdelivr. It is recommended to download it and host it on your server most of the time.
3535
:::

apps/website/docs/getting-started/usage.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It is recommended to read [Overview](/docs/overview) first.
1111
:::caution
1212
If you are a [vite](https://vitejs.dev/) user, use `esm` in **baseURL** instead of `umd`:
1313

14-
~~https://unpkg.com/@ffmpeg/[email protected]/dist/umd~~ => https://unpkg.com/@ffmpeg/[email protected]/dist/esm
14+
~~https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/umd~~ => https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected]/dist/esm
1515
:::
1616

1717
```jsx live
@@ -24,7 +24,7 @@ function() {
2424
const messageRef = useRef(null);
2525

2626
const load = async () => {
27-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
27+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
2828
const ffmpeg = ffmpegRef.current;
2929
ffmpeg.on('log', ({ message }) => {
3030
messageRef.current.innerHTML = message;
@@ -81,7 +81,7 @@ function() {
8181
const messageRef = useRef(null);
8282

8383
const load = async () => {
84-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
84+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
8585
const ffmpeg = ffmpegRef.current;
8686
ffmpeg.on('log', ({ message }) => {
8787
messageRef.current.innerHTML = message;
@@ -134,7 +134,7 @@ function() {
134134
const messageRef = useRef(null);
135135

136136
const load = async () => {
137-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
137+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
138138
const ffmpeg = ffmpegRef.current;
139139
ffmpeg.on('log', ({ message }) => {
140140
messageRef.current.innerHTML = message;
@@ -192,7 +192,7 @@ function() {
192192
const messageRef = useRef(null);
193193

194194
const load = async () => {
195-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
195+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
196196
const ffmpeg = ffmpegRef.current;
197197
// Listen to progress event instead of log.
198198
ffmpeg.on('progress', ({ progress, time }) => {
@@ -243,7 +243,7 @@ function() {
243243
const messageRef = useRef(null);
244244

245245
const load = async () => {
246-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
246+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
247247
const ffmpeg = ffmpegRef.current;
248248
ffmpeg.on('log', ({ message }) => {
249249
messageRef.current.innerHTML = message;
@@ -313,7 +313,7 @@ function() {
313313
const messageRef = useRef(null);
314314

315315
const load = async () => {
316-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
316+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
317317
const ffmpeg = ffmpegRef.current;
318318
ffmpeg.on('log', ({ message }) => {
319319
messageRef.current.innerHTML = message;
@@ -372,7 +372,7 @@ function() {
372372
const messageRef = useRef(null);
373373

374374
const load = async () => {
375-
const baseURL = 'https://unpkg.com/@ffmpeg/[email protected].6/dist/umd'
375+
const baseURL = 'https://cdn.jsdelivr.net/npm/@ffmpeg/[email protected].10/dist/umd'
376376
const ffmpeg = ffmpegRef.current;
377377
ffmpeg.on('log', ({ message }) => {
378378
messageRef.current.innerHTML = message;
@@ -426,7 +426,7 @@ function() {
426426
:::note
427427
Required:
428428

429-
- @ffmpeg/ffmpeg@0.12.6+
429+
- @ffmpeg/ffmpeg@0.12.10+
430430
- @ffmpeg/core@0.12.4+
431431
:::
432432

@@ -437,7 +437,7 @@ Please Check this PR: [Add WORKERFS support](https://github.com/ffmpegwasm/ffmpe
437437
:::note
438438
Required:
439439

440-
- @ffmpeg/ffmpeg@0.12.6+
440+
- @ffmpeg/ffmpeg@0.12.10+
441441
- @ffmpeg/core@0.12.4+
442442
:::
443443

apps/website/src/components/Playground/const.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
export const CORE_VERSION = "0.12.6";
1+
export const CORE_VERSION = "0.12.10";
22

3-
export const CORE_URL = `https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
4-
export const CORE_MT_URL = `https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
3+
export const CORE_URL = `https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
4+
export const CORE_MT_URL = `https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`;
55

66
export const CORE_SIZE = {
7-
[`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 114673,
8-
[`https://unpkg.com/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32129114,
9-
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 132680,
10-
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32609891,
11-
[`https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`]: 2915,
7+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 114673,
8+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32129114,
9+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.js`]: 132680,
10+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.wasm`]: 32609891,
11+
[`https://cdn.jsdelivr.net/npm/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`]: 2915,
1212
};
1313

1414
export const SAMPLE_FILES = {

0 commit comments

Comments
 (0)